﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using UnityEngine;

namespace SA
{
	// Token: 0x02000174 RID: 372
	[Serializable]
	public class FullBodyIK
	{
		// Token: 0x1700010B RID: 267
		// (get) Token: 0x060006F4 RID: 1780 RVA: 0x0003C34F File Offset: 0x0003A54F
		public FullBodyIK.Bone[] bones
		{
			get
			{
				return this._bones;
			}
		}

		// Token: 0x1700010C RID: 268
		// (get) Token: 0x060006F5 RID: 1781 RVA: 0x0003C357 File Offset: 0x0003A557
		public FullBodyIK.Effector[] effectors
		{
			get
			{
				return this._effectors;
			}
		}

		// Token: 0x060006F6 RID: 1782 RVA: 0x0003C35F File Offset: 0x0003A55F
		public void Awake(Transform rootTransorm_)
		{
			if (this.rootTransform != rootTransorm_)
			{
				this.rootTransform = rootTransorm_;
			}
			this._Prefix();
			this.ConfigureBoneTransforms();
			this.Prepare();
		}

		// Token: 0x060006F7 RID: 1783 RVA: 0x00002973 File Offset: 0x00000B73
		public void Destroy()
		{
		}

		// Token: 0x060006F8 RID: 1784 RVA: 0x0003C38C File Offset: 0x0003A58C
		private static void _SetBoneTransform(ref FullBodyIK.Bone bone, Transform transform)
		{
			if (bone == null)
			{
				bone = new FullBodyIK.Bone();
			}
			bone.transform = transform;
		}

		// Token: 0x060006F9 RID: 1785 RVA: 0x0003C3A4 File Offset: 0x0003A5A4
		private static void _SetFingerBoneTransform(ref FullBodyIK.Bone[] bones, Transform[,] transforms, int index)
		{
			if (bones == null || bones.Length != 4)
			{
				bones = new FullBodyIK.Bone[4];
			}
			for (int num = 0; num != 4; num++)
			{
				if (bones[num] == null)
				{
					bones[num] = new FullBodyIK.Bone();
				}
				bones[num].transform = transforms[index, num];
			}
		}

		// Token: 0x060006FA RID: 1786 RVA: 0x0003C400 File Offset: 0x0003A600
		private static bool _IsSpine(Transform trn)
		{
			if (trn != null)
			{
				string name = trn.name;
				if (name.Contains("Spine") || name.Contains("spine") || name.Contains("SPINE"))
				{
					return true;
				}
				if (name.Contains("Torso") || name.Contains("torso") || name.Contains("TORSO"))
				{
					return true;
				}
			}
			return false;
		}

		// Token: 0x060006FB RID: 1787 RVA: 0x0003C488 File Offset: 0x0003A688
		private static bool _IsNeck(Transform trn)
		{
			if (trn != null)
			{
				string name = trn.name;
				if (name != null)
				{
					if (name.Contains("Neck") || name.Contains("neck") || name.Contains("NECK"))
					{
						return true;
					}
					if (name.Contains("Kubi") || name.Contains("kubi") || name.Contains("KUBI"))
					{
						return true;
					}
					if (name.Contains("くび"))
					{
						return true;
					}
					if (name.Contains("クビ"))
					{
						return true;
					}
					if (name.Contains("首"))
					{
						return true;
					}
				}
			}
			return false;
		}

		// Token: 0x060006FC RID: 1788 RVA: 0x0003C549 File Offset: 0x0003A749
		public void Prefix(Transform rootTransform_)
		{
			if (this.rootTransform != rootTransform_)
			{
				this.rootTransform = rootTransform_;
			}
			this._Prefix();
		}

		// Token: 0x060006FD RID: 1789 RVA: 0x0003C56C File Offset: 0x0003A76C
		private void _Prefix()
		{
			if (this._isPrefixed)
			{
				return;
			}
			this._isPrefixed = true;
			FullBodyIK.SafeNew<FullBodyIK.BodyBones>(ref this.bodyBones);
			FullBodyIK.SafeNew<FullBodyIK.HeadBones>(ref this.headBones);
			FullBodyIK.SafeNew<FullBodyIK.LegBones>(ref this.leftLegBones);
			FullBodyIK.SafeNew<FullBodyIK.LegBones>(ref this.rightLegBones);
			FullBodyIK.SafeNew<FullBodyIK.ArmBones>(ref this.leftArmBones);
			this.leftArmBones.Repair();
			FullBodyIK.SafeNew<FullBodyIK.ArmBones>(ref this.rightArmBones);
			this.rightArmBones.Repair();
			FullBodyIK.SafeNew<FullBodyIK.FingersBones>(ref this.leftHandFingersBones);
			this.leftHandFingersBones.Repair();
			FullBodyIK.SafeNew<FullBodyIK.FingersBones>(ref this.rightHandFingersBones);
			this.rightHandFingersBones.Repair();
			FullBodyIK.SafeNew<FullBodyIK.BodyEffectors>(ref this.bodyEffectors);
			FullBodyIK.SafeNew<FullBodyIK.HeadEffectors>(ref this.headEffectors);
			FullBodyIK.SafeNew<FullBodyIK.ArmEffectors>(ref this.leftArmEffectors);
			FullBodyIK.SafeNew<FullBodyIK.ArmEffectors>(ref this.rightArmEffectors);
			FullBodyIK.SafeNew<FullBodyIK.LegEffectors>(ref this.leftLegEffectors);
			FullBodyIK.SafeNew<FullBodyIK.LegEffectors>(ref this.rightLegEffectors);
			FullBodyIK.SafeNew<FullBodyIK.FingersEffectors>(ref this.leftHandFingersEffectors);
			FullBodyIK.SafeNew<FullBodyIK.FingersEffectors>(ref this.rightHandFingersEffectors);
			FullBodyIK.SafeNew<FullBodyIK.Settings>(ref this.settings);
			FullBodyIK.SafeNew<FullBodyIK.EditorSettings>(ref this.editorSettings);
			FullBodyIK.SafeNew<FullBodyIK.InternalValues>(ref this.internalValues);
			this.settings.Prefix();
			if (this._bones == null || this._bones.Length != 79)
			{
				this._bones = new FullBodyIK.Bone[79];
			}
			if (this._effectors == null || this._effectors.Length != 25)
			{
				this._effectors = new FullBodyIK.Effector[25];
			}
			this._Prefix(ref this.bodyBones.hips, FullBodyIK.BoneLocation.Hips, null);
			this._Prefix(ref this.bodyBones.spine, FullBodyIK.BoneLocation.Spine, this.bodyBones.hips);
			this._Prefix(ref this.bodyBones.spine2, FullBodyIK.BoneLocation.Spine2, this.bodyBones.spine);
			this._Prefix(ref this.bodyBones.spine3, FullBodyIK.BoneLocation.Spine3, this.bodyBones.spine2);
			this._Prefix(ref this.bodyBones.spine4, FullBodyIK.BoneLocation.Spine4, this.bodyBones.spine3);
			this._Prefix(ref this.headBones.neck, FullBodyIK.BoneLocation.Neck, this.bodyBones.spineU);
			this._Prefix(ref this.headBones.head, FullBodyIK.BoneLocation.Head, this.headBones.neck);
			this._Prefix(ref this.headBones.leftEye, FullBodyIK.BoneLocation.LeftEye, this.headBones.head);
			this._Prefix(ref this.headBones.rightEye, FullBodyIK.BoneLocation.RightEye, this.headBones.head);
			for (int num = 0; num != 2; num++)
			{
				FullBodyIK.LegBones legBones = (num != 0) ? this.rightLegBones : this.leftLegBones;
				this._Prefix(ref legBones.leg, (num != 0) ? FullBodyIK.BoneLocation.RightLeg : FullBodyIK.BoneLocation.LeftLeg, this.bodyBones.hips);
				this._Prefix(ref legBones.knee, (num != 0) ? FullBodyIK.BoneLocation.RightKnee : FullBodyIK.BoneLocation.LeftKnee, legBones.leg);
				this._Prefix(ref legBones.foot, (num != 0) ? FullBodyIK.BoneLocation.RightFoot : FullBodyIK.BoneLocation.LeftFoot, legBones.knee);
				FullBodyIK.ArmBones armBones = (num != 0) ? this.rightArmBones : this.leftArmBones;
				this._Prefix(ref armBones.shoulder, (num != 0) ? FullBodyIK.BoneLocation.RightShoulder : FullBodyIK.BoneLocation.LeftShoulder, this.bodyBones.spineU);
				this._Prefix(ref armBones.arm, (num != 0) ? FullBodyIK.BoneLocation.RightArm : FullBodyIK.BoneLocation.LeftArm, armBones.shoulder);
				this._Prefix(ref armBones.elbow, (num != 0) ? FullBodyIK.BoneLocation.RightElbow : FullBodyIK.BoneLocation.LeftElbow, armBones.arm);
				this._Prefix(ref armBones.wrist, (num != 0) ? FullBodyIK.BoneLocation.RightWrist : FullBodyIK.BoneLocation.LeftWrist, armBones.elbow);
				for (int num2 = 0; num2 != 4; num2++)
				{
					FullBodyIK.BoneLocation boneLocation = (num != 0) ? FullBodyIK.BoneLocation.RightArmRoll0 : FullBodyIK.BoneLocation.LeftArmRoll0;
					this._Prefix(ref armBones.armRoll[num2], boneLocation + num2, armBones.arm);
				}
				for (int num3 = 0; num3 != 4; num3++)
				{
					FullBodyIK.BoneLocation boneLocation2 = (num != 0) ? FullBodyIK.BoneLocation.RightElbowRoll0 : FullBodyIK.BoneLocation.LeftElbowRoll0;
					this._Prefix(ref armBones.elbowRoll[num3], boneLocation2 + num3, armBones.elbow);
				}
				FullBodyIK.FingersBones fingersBones = (num != 0) ? this.rightHandFingersBones : this.leftHandFingersBones;
				for (int num4 = 0; num4 != 4; num4++)
				{
					FullBodyIK.BoneLocation boneLocation3 = (num != 0) ? FullBodyIK.BoneLocation.RightHandThumb0 : FullBodyIK.BoneLocation.LeftHandThumb0;
					FullBodyIK.BoneLocation boneLocation4 = (num != 0) ? FullBodyIK.BoneLocation.RightHandIndex0 : FullBodyIK.BoneLocation.LeftHandIndex0;
					FullBodyIK.BoneLocation boneLocation5 = (num != 0) ? FullBodyIK.BoneLocation.RightHandMiddle0 : FullBodyIK.BoneLocation.LeftHandMiddle0;
					FullBodyIK.BoneLocation boneLocation6 = (num != 0) ? FullBodyIK.BoneLocation.RightHandRing0 : FullBodyIK.BoneLocation.LeftHandRing0;
					FullBodyIK.BoneLocation boneLocation7 = (num != 0) ? FullBodyIK.BoneLocation.RightHandLittle0 : FullBodyIK.BoneLocation.LeftHandLittle0;
					this._Prefix(ref fingersBones.thumb[num4], boneLocation3 + num4, (num4 != 0) ? fingersBones.thumb[num4 - 1] : armBones.wrist);
					this._Prefix(ref fingersBones.index[num4], boneLocation4 + num4, (num4 != 0) ? fingersBones.index[num4 - 1] : armBones.wrist);
					this._Prefix(ref fingersBones.middle[num4], boneLocation5 + num4, (num4 != 0) ? fingersBones.middle[num4 - 1] : armBones.wrist);
					this._Prefix(ref fingersBones.ring[num4], boneLocation6 + num4, (num4 != 0) ? fingersBones.ring[num4 - 1] : armBones.wrist);
					this._Prefix(ref fingersBones.little[num4], boneLocation7 + num4, (num4 != 0) ? fingersBones.little[num4 - 1] : armBones.wrist);
				}
			}
			this._Prefix(ref this.rootEffector, FullBodyIK.EffectorLocation.Root);
			this._Prefix(ref this.bodyEffectors.hips, FullBodyIK.EffectorLocation.Hips, this.rootEffector, this.bodyBones.hips, this.leftLegBones.leg, this.rightLegBones.leg);
			this._Prefix(ref this.headEffectors.neck, FullBodyIK.EffectorLocation.Neck, this.bodyEffectors.hips, this.headBones.neck, null, null);
			this._Prefix(ref this.headEffectors.head, FullBodyIK.EffectorLocation.Head, this.headEffectors.neck, this.headBones.head, null, null);
			this._Prefix(ref this.headEffectors.eyes, FullBodyIK.EffectorLocation.Eyes, this.rootEffector, this.headBones.head, this.headBones.leftEye, this.headBones.rightEye);
			this._Prefix(ref this.leftLegEffectors.knee, FullBodyIK.EffectorLocation.LeftKnee, this.rootEffector, this.leftLegBones.knee, null, null);
			this._Prefix(ref this.leftLegEffectors.foot, FullBodyIK.EffectorLocation.LeftFoot, this.rootEffector, this.leftLegBones.foot, null, null);
			this._Prefix(ref this.rightLegEffectors.knee, FullBodyIK.EffectorLocation.RightKnee, this.rootEffector, this.rightLegBones.knee, null, null);
			this._Prefix(ref this.rightLegEffectors.foot, FullBodyIK.EffectorLocation.RightFoot, this.rootEffector, this.rightLegBones.foot, null, null);
			this._Prefix(ref this.leftArmEffectors.arm, FullBodyIK.EffectorLocation.LeftArm, this.bodyEffectors.hips, this.leftArmBones.arm, null, null);
			this._Prefix(ref this.leftArmEffectors.elbow, FullBodyIK.EffectorLocation.LeftElbow, this.bodyEffectors.hips, this.leftArmBones.elbow, null, null);
			this._Prefix(ref this.leftArmEffectors.wrist, FullBodyIK.EffectorLocation.LeftWrist, this.bodyEffectors.hips, this.leftArmBones.wrist, null, null);
			this._Prefix(ref this.rightArmEffectors.arm, FullBodyIK.EffectorLocation.RightArm, this.bodyEffectors.hips, this.rightArmBones.arm, null, null);
			this._Prefix(ref this.rightArmEffectors.elbow, FullBodyIK.EffectorLocation.RightElbow, this.bodyEffectors.hips, this.rightArmBones.elbow, null, null);
			this._Prefix(ref this.rightArmEffectors.wrist, FullBodyIK.EffectorLocation.RightWrist, this.bodyEffectors.hips, this.rightArmBones.wrist, null, null);
			this._Prefix(ref this.leftHandFingersEffectors.thumb, FullBodyIK.EffectorLocation.LeftHandThumb, this.leftArmEffectors.wrist, this.leftHandFingersBones.thumb);
			this._Prefix(ref this.leftHandFingersEffectors.index, FullBodyIK.EffectorLocation.LeftHandIndex, this.leftArmEffectors.wrist, this.leftHandFingersBones.index);
			this._Prefix(ref this.leftHandFingersEffectors.middle, FullBodyIK.EffectorLocation.LeftHandMiddle, this.leftArmEffectors.wrist, this.leftHandFingersBones.middle);
			this._Prefix(ref this.leftHandFingersEffectors.ring, FullBodyIK.EffectorLocation.LeftHandRing, this.leftArmEffectors.wrist, this.leftHandFingersBones.ring);
			this._Prefix(ref this.leftHandFingersEffectors.little, FullBodyIK.EffectorLocation.LeftHandLittle, this.leftArmEffectors.wrist, this.leftHandFingersBones.little);
			this._Prefix(ref this.rightHandFingersEffectors.thumb, FullBodyIK.EffectorLocation.RightHandThumb, this.rightArmEffectors.wrist, this.rightHandFingersBones.thumb);
			this._Prefix(ref this.rightHandFingersEffectors.index, FullBodyIK.EffectorLocation.RightHandIndex, this.rightArmEffectors.wrist, this.rightHandFingersBones.index);
			this._Prefix(ref this.rightHandFingersEffectors.middle, FullBodyIK.EffectorLocation.RightHandMiddle, this.rightArmEffectors.wrist, this.rightHandFingersBones.middle);
			this._Prefix(ref this.rightHandFingersEffectors.ring, FullBodyIK.EffectorLocation.RightHandRing, this.rightArmEffectors.wrist, this.rightHandFingersBones.ring);
			this._Prefix(ref this.rightHandFingersEffectors.little, FullBodyIK.EffectorLocation.RightHandLittle, this.rightArmEffectors.wrist, this.rightHandFingersBones.little);
			if (!this._isPrefixedAtLeastOnce)
			{
				this._isPrefixedAtLeastOnce = true;
				for (int num5 = 0; num5 != this._effectors.Length; num5++)
				{
					this._effectors[num5].Prefix();
				}
			}
		}

		// Token: 0x060006FE RID: 1790 RVA: 0x0003CF6C File Offset: 0x0003B16C
		public void CleanupBoneTransforms()
		{
			this._Prefix();
			if (this._bones != null)
			{
				for (int i = 0; i < this._bones.Length; i++)
				{
					if (this._bones[i] != null)
					{
						this._bones[i].transform = null;
					}
				}
			}
		}

		// Token: 0x060006FF RID: 1791 RVA: 0x0003CFC0 File Offset: 0x0003B1C0
		private static Transform _FindEye(Transform head, bool isRight)
		{
			if (head != null)
			{
				string[] array = (!isRight) ? FullBodyIK._LeftKeywords : FullBodyIK._RightKeywords;
				int childCount = head.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform child = head.GetChild(i);
					if (child != null)
					{
						string text = child.name;
						if (text != null)
						{
							text = text.ToLower();
							if (text != null && text.Contains("eye"))
							{
								for (int j = 0; j < array.Length; j++)
								{
									if (text.Contains(array[j]))
									{
										return child;
									}
								}
							}
						}
					}
				}
			}
			return null;
		}

		// Token: 0x06000700 RID: 1792 RVA: 0x0003D078 File Offset: 0x0003B278
		public void ConfigureBoneTransforms()
		{
			this._Prefix();
			if (this.settings.automaticPrepareHumanoid && this.rootTransform != null)
			{
				Animator component = this.rootTransform.GetComponent<Animator>();
				if (component != null && component.isHuman)
				{
					Transform boneTransform = component.GetBoneTransform(HumanBodyBones.Hips);
					Transform boneTransform2 = component.GetBoneTransform(HumanBodyBones.Spine);
					Transform transform = component.GetBoneTransform(HumanBodyBones.Chest);
					Transform transform2 = null;
					Transform transform3 = null;
					Transform transform4 = component.GetBoneTransform(HumanBodyBones.Neck);
					Transform boneTransform3 = component.GetBoneTransform(HumanBodyBones.Head);
					Transform transform5 = component.GetBoneTransform(HumanBodyBones.LeftEye);
					Transform transform6 = component.GetBoneTransform(HumanBodyBones.RightEye);
					Transform boneTransform4 = component.GetBoneTransform(HumanBodyBones.LeftUpperLeg);
					Transform boneTransform5 = component.GetBoneTransform(HumanBodyBones.RightUpperLeg);
					Transform boneTransform6 = component.GetBoneTransform(HumanBodyBones.LeftLowerLeg);
					Transform boneTransform7 = component.GetBoneTransform(HumanBodyBones.RightLowerLeg);
					Transform boneTransform8 = component.GetBoneTransform(HumanBodyBones.LeftFoot);
					Transform boneTransform9 = component.GetBoneTransform(HumanBodyBones.RightFoot);
					Transform boneTransform10 = component.GetBoneTransform(HumanBodyBones.LeftShoulder);
					Transform boneTransform11 = component.GetBoneTransform(HumanBodyBones.RightShoulder);
					Transform boneTransform12 = component.GetBoneTransform(HumanBodyBones.LeftUpperArm);
					Transform boneTransform13 = component.GetBoneTransform(HumanBodyBones.RightUpperArm);
					Transform boneTransform14 = component.GetBoneTransform(HumanBodyBones.LeftLowerArm);
					Transform boneTransform15 = component.GetBoneTransform(HumanBodyBones.RightLowerArm);
					Transform boneTransform16 = component.GetBoneTransform(HumanBodyBones.LeftHand);
					Transform boneTransform17 = component.GetBoneTransform(HumanBodyBones.RightHand);
					Transform[,] array = new Transform[5, 4];
					Transform[,] array2 = new Transform[5, 4];
					for (int num = 0; num != 2; num++)
					{
						int num2 = (num != 0) ? 39 : 24;
						Transform[,] array3 = (num != 0) ? array2 : array;
						for (int num3 = 0; num3 != 5; num3++)
						{
							int num4 = 0;
							while (num4 != 3)
							{
								array3[num3, num4] = component.GetBoneTransform((HumanBodyBones)num2);
								num4++;
								num2++;
							}
							if (array3[num3, 2] != null && array3[num3, 2].childCount != 0)
							{
								array3[num3, 3] = array3[num3, 2].GetChild(0);
							}
						}
					}
					if (transform4 == null && boneTransform3 != null)
					{
						Transform parent = boneTransform3.parent;
						if (parent != null && FullBodyIK._IsNeck(parent))
						{
							transform4 = parent;
						}
						else
						{
							transform4 = boneTransform3;
						}
					}
					if (transform5 == null)
					{
						transform5 = FullBodyIK._FindEye(boneTransform3, false);
					}
					if (transform6 == null)
					{
						transform6 = FullBodyIK._FindEye(boneTransform3, true);
					}
					if (this.settings.automaticConfigureSpineEnabled && boneTransform2 != null && transform4 != null)
					{
						List<Transform> list = new List<Transform>();
						Transform parent2 = transform4.parent;
						while (parent2 != null && parent2 != boneTransform2)
						{
							if (FullBodyIK._IsSpine(parent2))
							{
								list.Insert(0, parent2);
							}
							parent2 = parent2.parent;
						}
						list.Insert(0, boneTransform2);
						int num5 = 4;
						if (list.Count > num5)
						{
							list.RemoveRange(num5, list.Count - num5);
						}
						transform = ((list.Count < 2) ? null : list[1]);
						transform2 = ((list.Count < 3) ? null : list[2]);
						transform3 = ((list.Count < 4) ? null : list[3]);
					}
					FullBodyIK._SetBoneTransform(ref this.bodyBones.hips, boneTransform);
					FullBodyIK._SetBoneTransform(ref this.bodyBones.spine, boneTransform2);
					FullBodyIK._SetBoneTransform(ref this.bodyBones.spine2, transform);
					FullBodyIK._SetBoneTransform(ref this.bodyBones.spine3, transform2);
					FullBodyIK._SetBoneTransform(ref this.bodyBones.spine4, transform3);
					FullBodyIK._SetBoneTransform(ref this.headBones.neck, transform4);
					FullBodyIK._SetBoneTransform(ref this.headBones.head, boneTransform3);
					FullBodyIK._SetBoneTransform(ref this.headBones.leftEye, transform5);
					FullBodyIK._SetBoneTransform(ref this.headBones.rightEye, transform6);
					FullBodyIK._SetBoneTransform(ref this.leftLegBones.leg, boneTransform4);
					FullBodyIK._SetBoneTransform(ref this.leftLegBones.knee, boneTransform6);
					FullBodyIK._SetBoneTransform(ref this.leftLegBones.foot, boneTransform8);
					FullBodyIK._SetBoneTransform(ref this.rightLegBones.leg, boneTransform5);
					FullBodyIK._SetBoneTransform(ref this.rightLegBones.knee, boneTransform7);
					FullBodyIK._SetBoneTransform(ref this.rightLegBones.foot, boneTransform9);
					FullBodyIK._SetBoneTransform(ref this.leftArmBones.shoulder, boneTransform10);
					FullBodyIK._SetBoneTransform(ref this.leftArmBones.arm, boneTransform12);
					FullBodyIK._SetBoneTransform(ref this.leftArmBones.elbow, boneTransform14);
					FullBodyIK._SetBoneTransform(ref this.leftArmBones.wrist, boneTransform16);
					FullBodyIK._SetBoneTransform(ref this.rightArmBones.shoulder, boneTransform11);
					FullBodyIK._SetBoneTransform(ref this.rightArmBones.arm, boneTransform13);
					FullBodyIK._SetBoneTransform(ref this.rightArmBones.elbow, boneTransform15);
					FullBodyIK._SetBoneTransform(ref this.rightArmBones.wrist, boneTransform17);
					FullBodyIK._SetFingerBoneTransform(ref this.leftHandFingersBones.thumb, array, 0);
					FullBodyIK._SetFingerBoneTransform(ref this.leftHandFingersBones.index, array, 1);
					FullBodyIK._SetFingerBoneTransform(ref this.leftHandFingersBones.middle, array, 2);
					FullBodyIK._SetFingerBoneTransform(ref this.leftHandFingersBones.ring, array, 3);
					FullBodyIK._SetFingerBoneTransform(ref this.leftHandFingersBones.little, array, 4);
					FullBodyIK._SetFingerBoneTransform(ref this.rightHandFingersBones.thumb, array2, 0);
					FullBodyIK._SetFingerBoneTransform(ref this.rightHandFingersBones.index, array2, 1);
					FullBodyIK._SetFingerBoneTransform(ref this.rightHandFingersBones.middle, array2, 2);
					FullBodyIK._SetFingerBoneTransform(ref this.rightHandFingersBones.ring, array2, 3);
					FullBodyIK._SetFingerBoneTransform(ref this.rightHandFingersBones.little, array2, 4);
				}
			}
			if (this.settings.automaticConfigureRollBonesEnabled)
			{
				List<Transform> tempBones = new List<Transform>();
				for (int num6 = 0; num6 != 2; num6++)
				{
					FullBodyIK.ArmBones armBones = (num6 != 0) ? this.rightArmBones : this.leftArmBones;
					if (armBones != null && armBones.arm != null && armBones.arm.transform != null && armBones.elbow != null && armBones.elbow.transform != null && armBones.wrist != null && armBones.wrist.transform != null)
					{
						this._ConfigureRollBones(armBones.armRoll, tempBones, armBones.arm.transform, armBones.elbow.transform, (FullBodyIK.Side)num6, true);
						this._ConfigureRollBones(armBones.elbowRoll, tempBones, armBones.elbow.transform, armBones.wrist.transform, (FullBodyIK.Side)num6, false);
					}
				}
			}
		}

		// Token: 0x06000701 RID: 1793 RVA: 0x0003D744 File Offset: 0x0003B944
		private void _ConfigureRollBones(FullBodyIK.Bone[] bones, List<Transform> tempBones, Transform transform, Transform excludeTransform, FullBodyIK.Side side, bool isArm)
		{
			bool flag = false;
			string value;
			if (isArm)
			{
				value = ((side != FullBodyIK.Side.Left) ? "RightArmRoll" : "LeftArmRoll");
			}
			else
			{
				value = ((side != FullBodyIK.Side.Left) ? "RightElbowRoll" : "LeftElbowRoll");
			}
			int num = transform.childCount;
			for (int num2 = 0; num2 != num; num2++)
			{
				Transform child = transform.GetChild(num2);
				string name = child.name;
				if (name != null && name.Contains(value))
				{
					flag = true;
					break;
				}
			}
			tempBones.Clear();
			for (int num3 = 0; num3 != num; num3++)
			{
				Transform child2 = transform.GetChild(num3);
				string name2 = child2.name;
				if (name2 != null && excludeTransform != child2 && !excludeTransform.IsChildOf(child2))
				{
					if (flag)
					{
						if (name2.Contains(value))
						{
							char c = name2[name2.Length - 1];
							if (c >= '0' && c <= '9')
							{
								tempBones.Add(child2);
							}
						}
					}
					else
					{
						tempBones.Add(child2);
					}
				}
			}
			num = Mathf.Min(tempBones.Count, bones.Length);
			for (int num4 = 0; num4 != num; num4++)
			{
				FullBodyIK._SetBoneTransform(ref bones[num4], tempBones[num4]);
			}
		}

		// Token: 0x06000702 RID: 1794 RVA: 0x0003D8B0 File Offset: 0x0003BAB0
		public bool Prepare()
		{
			this._Prefix();
			if (this._isPrepared)
			{
				return false;
			}
			this._isPrepared = true;
			if (this.rootTransform != null)
			{
				this.internalValues.defaultRootPosition = this.rootTransform.position;
				this.internalValues.defaultRootBasis = FullBodyIK.Matrix3x3.FromColumn(this.rootTransform.right, this.rootTransform.up, this.rootTransform.forward);
				this.internalValues.defaultRootBasisInv = this.internalValues.defaultRootBasis.transpose;
				this.internalValues.defaultRootRotation = this.rootTransform.rotation;
			}
			if (this._bones != null)
			{
				int num = this._bones.Length;
				for (int num2 = 0; num2 != num; num2++)
				{
					if (this._bones[num2] != null)
					{
						this._bones[num2].Prepare(this);
					}
				}
				for (int num3 = 0; num3 != num; num3++)
				{
					if (this._bones[num3] != null)
					{
						this._bones[num3].PostPrepare();
					}
				}
			}
			this.boneCaches.Prepare(this);
			if (this._effectors != null)
			{
				int num4 = this._effectors.Length;
				for (int num5 = 0; num5 != num4; num5++)
				{
					if (this._effectors[num5] != null)
					{
						this._effectors[num5].Prepare(this);
					}
				}
			}
			if (this._limbIK == null || this._limbIK.Length != 4)
			{
				this._limbIK = new FullBodyIK.LimbIK[4];
			}
			for (int num6 = 0; num6 != 4; num6++)
			{
				this._limbIK[num6] = new FullBodyIK.LimbIK(this, (FullBodyIK.LimbIKLocation)num6);
			}
			this._bodyIK = new FullBodyIK.BodyIK(this, this._limbIK);
			this._headIK = new FullBodyIK.HeadIK(this);
			if (this._fingerIK == null || this._fingerIK.Length != 2)
			{
				this._fingerIK = new FullBodyIK.FingerIK[2];
			}
			for (int num7 = 0; num7 != 2; num7++)
			{
				this._fingerIK[num7] = new FullBodyIK.FingerIK(this, (FullBodyIK.FingerIKType)num7);
			}
			FullBodyIK.Bone neck = this.headBones.neck;
			FullBodyIK.Bone shoulder = this.leftArmBones.shoulder;
			FullBodyIK.Bone shoulder2 = this.rightArmBones.shoulder;
			if (shoulder != null && shoulder.transformIsAlive && shoulder2 != null && shoulder2.transformIsAlive && neck != null && neck.transformIsAlive && shoulder.transform.parent == neck.transform && shoulder2.transform.parent == neck.transform)
			{
				this._isNeedFixShoulderWorldTransform = true;
			}
			return true;
		}

		// Token: 0x06000703 RID: 1795 RVA: 0x0003DB78 File Offset: 0x0003BD78
		private void _UpdateInternalValues()
		{
			if (this.settings.animatorEnabled == FullBodyIK.AutomaticBool.Auto)
			{
				if (!this._isAnimatorCheckedAtLeastOnce)
				{
					this._isAnimatorCheckedAtLeastOnce = true;
					this.internalValues.animatorEnabled = false;
					if (this.rootTransform != null)
					{
						Animator component = this.rootTransform.GetComponent<Animator>();
						if (component != null && component.enabled)
						{
							RuntimeAnimatorController runtimeAnimatorController = component.runtimeAnimatorController;
							this.internalValues.animatorEnabled = (runtimeAnimatorController != null);
						}
						if (component == null)
						{
							Animation component2 = this.rootTransform.GetComponent<Animation>();
							if (component2 != null && component2.enabled && component2.GetClipCount() > 0)
							{
								this.internalValues.animatorEnabled = true;
							}
						}
					}
				}
			}
			else
			{
				this.internalValues.animatorEnabled = (this.settings.animatorEnabled != FullBodyIK.AutomaticBool.Disable);
				this._isAnimatorCheckedAtLeastOnce = false;
			}
			if (this.settings.resetTransforms == FullBodyIK.AutomaticBool.Auto)
			{
				this.internalValues.resetTransforms = !this.internalValues.animatorEnabled;
			}
			else
			{
				this.internalValues.resetTransforms = (this.settings.resetTransforms != FullBodyIK.AutomaticBool.Disable);
			}
			this.internalValues.continuousSolverEnabled = (!this.internalValues.animatorEnabled && !this.internalValues.resetTransforms);
			this.internalValues.bodyIK.Update(this.settings.bodyIK);
			this.internalValues.limbIK.Update(this.settings.limbIK);
			this.internalValues.headIK.Update(this.settings.headIK);
		}

		// Token: 0x06000704 RID: 1796 RVA: 0x0003DD38 File Offset: 0x0003BF38
		private void _Bones_SyncDisplacement()
		{
			if (this.settings.syncDisplacement != FullBodyIK.SyncDisplacement.Disable && (this.settings.syncDisplacement == FullBodyIK.SyncDisplacement.Everyframe || !this._isSyncDisplacementAtLeastOnce))
			{
				this._isSyncDisplacementAtLeastOnce = true;
				if (this._bones != null)
				{
					int num = this._bones.Length;
					for (int num2 = 0; num2 != num; num2++)
					{
						if (this._bones[num2] != null)
						{
							this._bones[num2].SyncDisplacement();
						}
					}
					this.boneCaches._SyncDisplacement(this);
					for (int num3 = 0; num3 != num; num3++)
					{
						if (this._bones[num3] != null)
						{
							this._bones[num3].PostSyncDisplacement(this);
						}
					}
					for (int num4 = 0; num4 != num; num4++)
					{
						if (this._bones[num4] != null)
						{
							this._bones[num4].PostPrepare();
						}
					}
				}
				if (this._effectors != null)
				{
					int num5 = this._effectors.Length;
					for (int num6 = 0; num6 != num5; num6++)
					{
						if (this._effectors[num6] != null)
						{
							this._effectors[num6]._ComputeDefaultTransform(this);
						}
					}
				}
			}
		}

		// Token: 0x06000705 RID: 1797 RVA: 0x0003DE68 File Offset: 0x0003C068
		private void _ComputeBaseHipsTransform()
		{
			if (this.bodyEffectors == null)
			{
				return;
			}
			FullBodyIK.Effector hips = this.bodyEffectors.hips;
			if (hips == null || this.rootEffector == null)
			{
				return;
			}
			if (hips.rotationEnabled && hips.rotationWeight > 1E-07f)
			{
				Quaternion b = hips.worldRotation * FullBodyIK.Inverse(hips._defaultRotation);
				if (hips.rotationWeight < 0.9999999f)
				{
					Quaternion a = this.rootEffector.worldRotation * FullBodyIK.Inverse(this.rootEffector._defaultRotation);
					Quaternion quaternion = Quaternion.Lerp(a, b, hips.rotationWeight);
					FullBodyIK.SAFBIKMatSetRot(out this.internalValues.baseHipsBasis, ref quaternion);
				}
				else
				{
					FullBodyIK.SAFBIKMatSetRot(out this.internalValues.baseHipsBasis, ref b);
				}
			}
			else
			{
				Quaternion worldRotation = this.rootEffector.worldRotation;
				FullBodyIK.SAFBIKMatSetRotMultInv1(out this.internalValues.baseHipsBasis, ref worldRotation, ref this.rootEffector._defaultRotation);
			}
			if (hips.positionEnabled && hips.positionWeight > 1E-07f)
			{
				Vector3 worldPosition = hips.worldPosition;
				FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.internalValues.baseHipsPos, ref this.internalValues.baseHipsBasis, ref this.rootEffector._defaultPosition, ref hips._defaultPosition, ref worldPosition);
				if (hips.positionWeight < 0.9999999f)
				{
					Vector3 worldPosition2 = this.rootEffector.worldPosition;
					Vector3 a2;
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out a2, ref this.internalValues.baseHipsBasis, ref hips._defaultPosition, ref this.rootEffector._defaultPosition, ref worldPosition2);
					this.internalValues.baseHipsPos = Vector3.Lerp(a2, this.internalValues.baseHipsPos, hips.positionWeight);
				}
			}
			else
			{
				Vector3 worldPosition3 = this.rootEffector.worldPosition;
				FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.internalValues.baseHipsPos, ref this.internalValues.baseHipsBasis, ref hips._defaultPosition, ref this.rootEffector._defaultPosition, ref worldPosition3);
			}
		}

		// Token: 0x06000706 RID: 1798 RVA: 0x0003E060 File Offset: 0x0003C260
		public void Update()
		{
			this._UpdateInternalValues();
			if (this._effectors != null)
			{
				int num = this._effectors.Length;
				for (int num2 = 0; num2 != num; num2++)
				{
					if (this._effectors[num2] != null)
					{
						this._effectors[num2].PrepareUpdate();
					}
				}
			}
			this._Bones_PrepareUpdate();
			this._Bones_SyncDisplacement();
			if (this.internalValues.resetTransforms || this.internalValues.continuousSolverEnabled)
			{
				this._ComputeBaseHipsTransform();
			}
			if (this._effectors != null)
			{
				int num3 = this._effectors.Length;
				for (int num4 = 0; num4 != num3; num4++)
				{
					FullBodyIK.Effector effector = this._effectors[num4];
					if (effector != null)
					{
						if (effector.effectorType != FullBodyIK.EffectorType.Eyes && effector.effectorType != FullBodyIK.EffectorType.HandFinger)
						{
							float num5 = (!effector.positionEnabled) ? 0f : effector.positionWeight;
							Vector3 vector = (num5 <= 1E-07f) ? default(Vector3) : effector.worldPosition;
							if (num5 < 0.9999999f)
							{
								Vector3 vector2 = vector;
								if (!this.internalValues.animatorEnabled && (this.internalValues.resetTransforms || this.internalValues.continuousSolverEnabled))
								{
									if (effector.effectorLocation == FullBodyIK.EffectorLocation.Hips)
									{
										vector2 = this.internalValues.baseHipsPos;
									}
									else
									{
										FullBodyIK.Effector effector2 = (this.bodyEffectors == null) ? null : this.bodyEffectors.hips;
										if (effector2 != null)
										{
											FullBodyIK.SAFBIKMatMultVecPreSubAdd(out vector2, ref this.internalValues.baseHipsBasis, ref effector._defaultPosition, ref effector2._defaultPosition, ref this.internalValues.baseHipsPos);
										}
									}
								}
								else if (effector.bone != null && effector.bone.transformIsAlive)
								{
									vector2 = effector.bone.worldPosition;
								}
								if (num5 > 1E-07f)
								{
									effector._hidden_worldPosition = Vector3.Lerp(vector2, vector, num5);
								}
								else
								{
									effector._hidden_worldPosition = vector2;
								}
							}
							else
							{
								effector._hidden_worldPosition = vector;
							}
						}
					}
				}
			}
			if (this._limbIK != null)
			{
				int num6 = this._limbIK.Length;
				for (int num7 = 0; num7 != num6; num7++)
				{
					if (this._limbIK[num7] != null)
					{
						this._limbIK[num7].PresolveBeinding();
					}
				}
			}
			if (this._bodyIK != null && this._bodyIK.Solve())
			{
				this._Bones_WriteToTransform();
			}
			if (this._limbIK != null || this._headIK != null)
			{
				this._Bones_PrepareUpdate();
				bool flag = false;
				bool flag2 = false;
				if (this._limbIK != null)
				{
					int num8 = this._limbIK.Length;
					for (int num9 = 0; num9 != num8; num9++)
					{
						if (this._limbIK[num9] != null)
						{
							flag |= this._limbIK[num9].Solve();
						}
					}
				}
				if (this._headIK != null)
				{
					flag2 = this._headIK.Solve(this);
					flag = (flag || flag2);
				}
				if (flag2 && this._isNeedFixShoulderWorldTransform)
				{
					if (this.leftArmBones.shoulder != null)
					{
						this.leftArmBones.shoulder.forcefix_worldRotation();
					}
					if (this.rightArmBones.shoulder != null)
					{
						this.rightArmBones.shoulder.forcefix_worldRotation();
					}
				}
				if (flag)
				{
					this._Bones_WriteToTransform();
				}
			}
			if (this._fingerIK != null)
			{
				this._Bones_PrepareUpdate();
				bool flag3 = false;
				int num10 = this._fingerIK.Length;
				for (int num11 = 0; num11 != num10; num11++)
				{
					if (this._fingerIK[num11] != null)
					{
						flag3 |= this._fingerIK[num11].Solve();
					}
				}
				if (flag3)
				{
					this._Bones_WriteToTransform();
				}
			}
		}

		// Token: 0x06000707 RID: 1799 RVA: 0x0003E454 File Offset: 0x0003C654
		private void _Bones_PrepareUpdate()
		{
			if (this._bones != null)
			{
				int num = this._bones.Length;
				for (int num2 = 0; num2 != num; num2++)
				{
					if (this._bones[num2] != null)
					{
						this._bones[num2].PrepareUpdate();
					}
				}
			}
		}

		// Token: 0x06000708 RID: 1800 RVA: 0x0003E4A4 File Offset: 0x0003C6A4
		private void _Bones_WriteToTransform()
		{
			if (this._bones != null)
			{
				int num = this._bones.Length;
				for (int num2 = 0; num2 != num; num2++)
				{
					if (this._bones[num2] != null)
					{
						this._bones[num2].WriteToTransform();
					}
				}
			}
		}

		// Token: 0x06000709 RID: 1801 RVA: 0x0003E4F1 File Offset: 0x0003C6F1
		private void _Prefix(ref FullBodyIK.Bone bone, FullBodyIK.BoneLocation boneLocation, FullBodyIK.Bone parentBoneLocationBased)
		{
			FullBodyIK.Bone.Prefix(this._bones, ref bone, boneLocation, parentBoneLocationBased);
		}

		// Token: 0x0600070A RID: 1802 RVA: 0x0003E504 File Offset: 0x0003C704
		private void _Prefix(ref FullBodyIK.Effector effector, FullBodyIK.EffectorLocation effectorLocation)
		{
			bool createEffectorTransform = this.settings.createEffectorTransform;
			FullBodyIK.Effector.Prefix(this._effectors, ref effector, effectorLocation, createEffectorTransform, this.rootTransform, null, null, null, null);
		}

		// Token: 0x0600070B RID: 1803 RVA: 0x0003E535 File Offset: 0x0003C735
		private void _Prefix(ref FullBodyIK.Effector effector, FullBodyIK.EffectorLocation effectorLocation, FullBodyIK.Effector parentEffector, FullBodyIK.Bone[] bones)
		{
			this._Prefix(ref effector, effectorLocation, parentEffector, (bones == null || bones.Length <= 0) ? null : bones[bones.Length - 1], null, null);
		}

		// Token: 0x0600070C RID: 1804 RVA: 0x0003E564 File Offset: 0x0003C764
		private void _Prefix(ref FullBodyIK.Effector effector, FullBodyIK.EffectorLocation effectorLocation, FullBodyIK.Effector parentEffector, FullBodyIK.Bone bone, FullBodyIK.Bone leftBone = null, FullBodyIK.Bone rightBone = null)
		{
			bool createEffectorTransform = this.settings.createEffectorTransform;
			FullBodyIK.Effector.Prefix(this._effectors, ref effector, effectorLocation, createEffectorTransform, null, parentEffector, bone, leftBone, rightBone);
		}

		// Token: 0x0600070D RID: 1805 RVA: 0x0001D4CA File Offset: 0x0001B6CA
		public virtual bool _IsHiddenCustomEyes()
		{
			return false;
		}

		// Token: 0x0600070E RID: 1806 RVA: 0x0001D4CA File Offset: 0x0001B6CA
		public virtual bool _PrepareCustomEyes(ref Quaternion headToLeftEyeRotation, ref Quaternion headToRightEyeRotation)
		{
			return false;
		}

		// Token: 0x0600070F RID: 1807 RVA: 0x00002973 File Offset: 0x00000B73
		public virtual void _ResetCustomEyes()
		{
		}

		// Token: 0x06000710 RID: 1808 RVA: 0x00002973 File Offset: 0x00000B73
		public virtual void _SolveCustomEyes(ref FullBodyIK.Matrix3x3 neckBasis, ref FullBodyIK.Matrix3x3 headBasis, ref FullBodyIK.Matrix3x3 headBaseBasis)
		{
		}

		// Token: 0x06000711 RID: 1809 RVA: 0x0003E593 File Offset: 0x0003C793
		public static float SAFBIKSqrt(float a)
		{
			if (a <= 1E-45f)
			{
				return 0f;
			}
			return (float)Math.Sqrt((double)a);
		}

		// Token: 0x06000712 RID: 1810 RVA: 0x0003E5AE File Offset: 0x0003C7AE
		public static float SAFBIKSqrtClamp01(float a)
		{
			if (a <= 1E-45f)
			{
				return 0f;
			}
			if (a >= 1f)
			{
				return 1f;
			}
			return (float)Math.Sqrt((double)a);
		}

		// Token: 0x06000713 RID: 1811 RVA: 0x0003E5DA File Offset: 0x0003C7DA
		public static float SAFBIKSin(float a)
		{
			return (float)Math.Sin((double)a);
		}

		// Token: 0x06000714 RID: 1812 RVA: 0x0003E5E4 File Offset: 0x0003C7E4
		public static float SAFBIKCos(float a)
		{
			return (float)Math.Cos((double)a);
		}

		// Token: 0x06000715 RID: 1813 RVA: 0x0003E5EE File Offset: 0x0003C7EE
		public static void SAFBIKCosSin(out float cos, out float sin, float a)
		{
			cos = (float)Math.Cos((double)a);
			sin = (float)Math.Sin((double)a);
		}

		// Token: 0x06000716 RID: 1814 RVA: 0x0003E604 File Offset: 0x0003C804
		public static float SAFBIKTan(float a)
		{
			return (float)Math.Tan((double)a);
		}

		// Token: 0x06000717 RID: 1815 RVA: 0x0003E60E File Offset: 0x0003C80E
		public static float SAFBIKAcos(float cos)
		{
			if (cos >= 1f)
			{
				return 0f;
			}
			if (cos <= -1f)
			{
				return 3.1415927f;
			}
			return (float)Math.Acos((double)cos);
		}

		// Token: 0x06000718 RID: 1816 RVA: 0x0003E63A File Offset: 0x0003C83A
		public static float SAFBIKAsin(float sin)
		{
			if (sin >= 1f)
			{
				return 1.5707964f;
			}
			if (sin <= -1f)
			{
				return -1.5707964f;
			}
			return (float)Math.Asin((double)sin);
		}

		// Token: 0x06000719 RID: 1817 RVA: 0x0003E668 File Offset: 0x0003C868
		public static void SAFBIKVecCross(out Vector3 ret, ref Vector3 lhs, ref Vector3 rhs)
		{
			ret = new Vector3(lhs.y * rhs.z - lhs.z * rhs.y, lhs.z * rhs.x - lhs.x * rhs.z, lhs.x * rhs.y - lhs.y * rhs.x);
		}

		// Token: 0x0600071A RID: 1818 RVA: 0x0003E6CC File Offset: 0x0003C8CC
		public static float SAFBIKVecLength(ref Vector3 v)
		{
			float num = v.x * v.x + v.y * v.y + v.z * v.z;
			if (num > 1E-45f)
			{
				return (float)Math.Sqrt((double)num);
			}
			return 0f;
		}

		// Token: 0x0600071B RID: 1819 RVA: 0x0003E71C File Offset: 0x0003C91C
		public static float SAFBIKVecLengthAndLengthSq(out float lengthSq, ref Vector3 v)
		{
			lengthSq = v.x * v.x + v.y * v.y + v.z * v.z;
			if (lengthSq > 1E-45f)
			{
				return (float)Math.Sqrt((double)lengthSq);
			}
			return 0f;
		}

		// Token: 0x0600071C RID: 1820 RVA: 0x0003E770 File Offset: 0x0003C970
		public static float SAFBIKVecLength2(ref Vector3 lhs, ref Vector3 rhs)
		{
			float num = lhs.x - rhs.x;
			float num2 = lhs.y - rhs.y;
			float num3 = lhs.z - rhs.z;
			float num4 = num * num + num2 * num2 + num3 * num3;
			if (num4 > 1E-45f)
			{
				return (float)Math.Sqrt((double)num4);
			}
			return 0f;
		}

		// Token: 0x0600071D RID: 1821 RVA: 0x0003E7CC File Offset: 0x0003C9CC
		public static float SAFBIKVecLengthSq2(ref Vector3 lhs, ref Vector3 rhs)
		{
			float num = lhs.x - rhs.x;
			float num2 = lhs.y - rhs.y;
			float num3 = lhs.z - rhs.z;
			return num * num + num2 * num2 + num3 * num3;
		}

		// Token: 0x0600071E RID: 1822 RVA: 0x0003E810 File Offset: 0x0003CA10
		public static float SAFBIKVecLengthAndLengthSq2(out float lengthSq, ref Vector3 lhs, ref Vector3 rhs)
		{
			float num = lhs.x - rhs.x;
			float num2 = lhs.y - rhs.y;
			float num3 = lhs.z - rhs.z;
			lengthSq = num * num + num2 * num2 + num3 * num3;
			if (lengthSq > 1E-45f)
			{
				return (float)Math.Sqrt((double)lengthSq);
			}
			return 0f;
		}

		// Token: 0x0600071F RID: 1823 RVA: 0x0003E870 File Offset: 0x0003CA70
		public static bool SAFBIKVecNormalize(ref Vector3 v0)
		{
			float num = v0.x * v0.x + v0.y * v0.y + v0.z * v0.z;
			if (num > 1E-45f)
			{
				float num2 = (float)Math.Sqrt((double)num);
				if (num2 > 1E-07f)
				{
					num2 = 1f / num2;
					v0.x *= num2;
					v0.y *= num2;
					v0.z *= num2;
					return true;
				}
			}
			v0.x = (v0.y = (v0.z = 0f));
			return false;
		}

		// Token: 0x06000720 RID: 1824 RVA: 0x0003E918 File Offset: 0x0003CB18
		public static bool SAFBIKVecNormalizeXZ(ref Vector3 v0)
		{
			float num = v0.x * v0.x + v0.z * v0.z;
			if (num > 1E-45f)
			{
				float num2 = (float)Math.Sqrt((double)num);
				if (num2 > 1E-07f)
				{
					num2 = 1f / num2;
					v0.x *= num2;
					v0.z *= num2;
					return true;
				}
			}
			v0.x = (v0.z = 0f);
			return false;
		}

		// Token: 0x06000721 RID: 1825 RVA: 0x0003E99C File Offset: 0x0003CB9C
		public static bool SAFBIKVecNormalizeYZ(ref Vector3 v0)
		{
			float num = v0.y * v0.y + v0.z * v0.z;
			if (num > 1E-45f)
			{
				float num2 = (float)Math.Sqrt((double)num);
				if (num2 > 1E-07f)
				{
					num2 = 1f / num2;
					v0.y *= num2;
					v0.z *= num2;
					return true;
				}
			}
			v0.y = (v0.z = 0f);
			return false;
		}

		// Token: 0x06000722 RID: 1826 RVA: 0x0003EA20 File Offset: 0x0003CC20
		public static bool SAFBIKVecNormalize2(ref Vector3 v0, ref Vector3 v1)
		{
			bool flag = FullBodyIK.SAFBIKVecNormalize(ref v0);
			bool flag2 = FullBodyIK.SAFBIKVecNormalize(ref v1);
			return flag && flag2;
		}

		// Token: 0x06000723 RID: 1827 RVA: 0x0003EA48 File Offset: 0x0003CC48
		public static bool SAFBIKVecNormalize3(ref Vector3 v0, ref Vector3 v1, ref Vector3 v2)
		{
			bool flag = FullBodyIK.SAFBIKVecNormalize(ref v0);
			bool flag2 = FullBodyIK.SAFBIKVecNormalize(ref v1);
			bool flag3 = FullBodyIK.SAFBIKVecNormalize(ref v2);
			return flag && flag2 && flag3;
		}

		// Token: 0x06000724 RID: 1828 RVA: 0x0003EA7C File Offset: 0x0003CC7C
		public static bool SAFBIKVecNormalize4(ref Vector3 v0, ref Vector3 v1, ref Vector3 v2, ref Vector3 v3)
		{
			bool flag = FullBodyIK.SAFBIKVecNormalize(ref v0);
			bool flag2 = FullBodyIK.SAFBIKVecNormalize(ref v1);
			bool flag3 = FullBodyIK.SAFBIKVecNormalize(ref v2);
			bool flag4 = FullBodyIK.SAFBIKVecNormalize(ref v3);
			return flag && flag2 && flag3 && flag4;
		}

		// Token: 0x06000725 RID: 1829 RVA: 0x0003EABC File Offset: 0x0003CCBC
		public static void SAFBIKMatMult(out FullBodyIK.Matrix3x3 ret, ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs)
		{
			ret = new FullBodyIK.Matrix3x3(lhs.column0.x * rhs.column0.x + lhs.column1.x * rhs.column0.y + lhs.column2.x * rhs.column0.z, lhs.column0.x * rhs.column1.x + lhs.column1.x * rhs.column1.y + lhs.column2.x * rhs.column1.z, lhs.column0.x * rhs.column2.x + lhs.column1.x * rhs.column2.y + lhs.column2.x * rhs.column2.z, lhs.column0.y * rhs.column0.x + lhs.column1.y * rhs.column0.y + lhs.column2.y * rhs.column0.z, lhs.column0.y * rhs.column1.x + lhs.column1.y * rhs.column1.y + lhs.column2.y * rhs.column1.z, lhs.column0.y * rhs.column2.x + lhs.column1.y * rhs.column2.y + lhs.column2.y * rhs.column2.z, lhs.column0.z * rhs.column0.x + lhs.column1.z * rhs.column0.y + lhs.column2.z * rhs.column0.z, lhs.column0.z * rhs.column1.x + lhs.column1.z * rhs.column1.y + lhs.column2.z * rhs.column1.z, lhs.column0.z * rhs.column2.x + lhs.column1.z * rhs.column2.y + lhs.column2.z * rhs.column2.z);
		}

		// Token: 0x06000726 RID: 1830 RVA: 0x0003ED50 File Offset: 0x0003CF50
		public static void SAFBIKMatMultRet0(ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs)
		{
			lhs = new FullBodyIK.Matrix3x3(lhs.column0.x * rhs.column0.x + lhs.column1.x * rhs.column0.y + lhs.column2.x * rhs.column0.z, lhs.column0.x * rhs.column1.x + lhs.column1.x * rhs.column1.y + lhs.column2.x * rhs.column1.z, lhs.column0.x * rhs.column2.x + lhs.column1.x * rhs.column2.y + lhs.column2.x * rhs.column2.z, lhs.column0.y * rhs.column0.x + lhs.column1.y * rhs.column0.y + lhs.column2.y * rhs.column0.z, lhs.column0.y * rhs.column1.x + lhs.column1.y * rhs.column1.y + lhs.column2.y * rhs.column1.z, lhs.column0.y * rhs.column2.x + lhs.column1.y * rhs.column2.y + lhs.column2.y * rhs.column2.z, lhs.column0.z * rhs.column0.x + lhs.column1.z * rhs.column0.y + lhs.column2.z * rhs.column0.z, lhs.column0.z * rhs.column1.x + lhs.column1.z * rhs.column1.y + lhs.column2.z * rhs.column1.z, lhs.column0.z * rhs.column2.x + lhs.column1.z * rhs.column2.y + lhs.column2.z * rhs.column2.z);
		}

		// Token: 0x06000727 RID: 1831 RVA: 0x0003EFE4 File Offset: 0x0003D1E4
		public static void SAFBIKMatMultCol0(out Vector3 ret, ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs)
		{
			ret = new Vector3(lhs.column0.x * rhs.column0.x + lhs.column1.x * rhs.column0.y + lhs.column2.x * rhs.column0.z, lhs.column0.y * rhs.column0.x + lhs.column1.y * rhs.column0.y + lhs.column2.y * rhs.column0.z, lhs.column0.z * rhs.column0.x + lhs.column1.z * rhs.column0.y + lhs.column2.z * rhs.column0.z);
		}

		// Token: 0x06000728 RID: 1832 RVA: 0x0003F0CC File Offset: 0x0003D2CC
		public static void SAFBIKMatMultCol1(out Vector3 ret, ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs)
		{
			ret = new Vector3(lhs.column0.x * rhs.column1.x + lhs.column1.x * rhs.column1.y + lhs.column2.x * rhs.column1.z, lhs.column0.y * rhs.column1.x + lhs.column1.y * rhs.column1.y + lhs.column2.y * rhs.column1.z, lhs.column0.z * rhs.column1.x + lhs.column1.z * rhs.column1.y + lhs.column2.z * rhs.column1.z);
		}

		// Token: 0x06000729 RID: 1833 RVA: 0x0003F1B4 File Offset: 0x0003D3B4
		public static void SAFBIKMatMultCol2(out Vector3 ret, ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs)
		{
			ret = new Vector3(lhs.column0.x * rhs.column2.x + lhs.column1.x * rhs.column2.y + lhs.column2.x * rhs.column2.z, lhs.column0.y * rhs.column2.x + lhs.column1.y * rhs.column2.y + lhs.column2.y * rhs.column2.z, lhs.column0.z * rhs.column2.x + lhs.column1.z * rhs.column2.y + lhs.column2.z * rhs.column2.z);
		}

		// Token: 0x0600072A RID: 1834 RVA: 0x0003F29C File Offset: 0x0003D49C
		public static void SAFBIKMatMultVec(out Vector3 ret, ref FullBodyIK.Matrix3x3 m, ref Vector3 v)
		{
			ret = new Vector3(m.column0.x * v.x + m.column1.x * v.y + m.column2.x * v.z, m.column0.y * v.x + m.column1.y * v.y + m.column2.y * v.z, m.column0.z * v.x + m.column1.z * v.y + m.column2.z * v.z);
		}

		// Token: 0x0600072B RID: 1835 RVA: 0x0003F358 File Offset: 0x0003D558
		public static void SAFBIKMatGetRot(out Quaternion q, ref FullBodyIK.Matrix3x3 m)
		{
			q = default(Quaternion);
			float num = m.column0.x + m.column1.y + m.column2.z;
			if (num > 0f)
			{
				float num2 = (float)Math.Sqrt((double)(num + 1f));
				q.w = num2 * 0.5f;
				num2 = 0.5f / num2;
				q.x = (m.column1.z - m.column2.y) * num2;
				q.y = (m.column2.x - m.column0.z) * num2;
				q.z = (m.column0.y - m.column1.x) * num2;
			}
			else if (m.column0.x > m.column1.y && m.column0.x > m.column2.z)
			{
				float num3 = m.column0.x - m.column1.y - m.column2.z + 1f;
				if (num3 <= 1E-45f)
				{
					q = Quaternion.identity;
					return;
				}
				num3 = (float)Math.Sqrt((double)num3);
				q.x = num3 * 0.5f;
				num3 = 0.5f / num3;
				q.w = (m.column1.z - m.column2.y) * num3;
				q.y = (m.column0.y + m.column1.x) * num3;
				q.z = (m.column0.z + m.column2.x) * num3;
			}
			else if (m.column1.y > m.column2.z)
			{
				float num4 = m.column1.y - m.column0.x - m.column2.z + 1f;
				if (num4 <= 1E-45f)
				{
					q = Quaternion.identity;
					return;
				}
				num4 = (float)Math.Sqrt((double)num4);
				q.y = num4 * 0.5f;
				num4 = 0.5f / num4;
				q.w = (m.column2.x - m.column0.z) * num4;
				q.z = (m.column1.z + m.column2.y) * num4;
				q.x = (m.column1.x + m.column0.y) * num4;
			}
			else
			{
				float num5 = m.column2.z - m.column0.x - m.column1.y + 1f;
				if (num5 <= 1E-45f)
				{
					q = Quaternion.identity;
					return;
				}
				num5 = (float)Math.Sqrt((double)num5);
				q.z = num5 * 0.5f;
				num5 = 0.5f / num5;
				q.w = (m.column0.y - m.column1.x) * num5;
				q.x = (m.column2.x + m.column0.z) * num5;
				q.y = (m.column2.y + m.column1.z) * num5;
			}
		}

		// Token: 0x0600072C RID: 1836 RVA: 0x0003F6BC File Offset: 0x0003D8BC
		public static void SAFBIKMatSetRot(out FullBodyIK.Matrix3x3 m, ref Quaternion q)
		{
			float num = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w;
			float num2 = (num <= float.Epsilon) ? 0f : (2f / num);
			float num3 = q.x * num2;
			float num4 = q.y * num2;
			float num5 = q.z * num2;
			float num6 = q.w * num3;
			float num7 = q.w * num4;
			float num8 = q.w * num5;
			float num9 = q.x * num3;
			float num10 = q.x * num4;
			float num11 = q.x * num5;
			float num12 = q.y * num4;
			float num13 = q.y * num5;
			float num14 = q.z * num5;
			m.column0.x = 1f - (num12 + num14);
			m.column1.x = num10 - num8;
			m.column2.x = num11 + num7;
			m.column0.y = num10 + num8;
			m.column1.y = 1f - (num9 + num14);
			m.column2.y = num13 - num6;
			m.column0.z = num11 - num7;
			m.column1.z = num13 + num6;
			m.column2.z = 1f - (num9 + num12);
		}

		// Token: 0x0600072D RID: 1837 RVA: 0x0003F83C File Offset: 0x0003DA3C
		public static void SAFBIKMatSetAxisAngle(out FullBodyIK.Matrix3x3 m, ref Vector3 axis, float cos)
		{
			if (cos >= -1E-45f && cos <= 1E-45f)
			{
				m = FullBodyIK.Matrix3x3.identity;
				return;
			}
			m = default(FullBodyIK.Matrix3x3);
			float num = 1f - cos * cos;
			num = ((num > float.Epsilon) ? ((num < 1f) ? ((float)Math.Sqrt((double)num)) : 1f) : 0f);
			float num2 = axis.x * num;
			float num3 = axis.y * num;
			float num4 = axis.z * num;
			m.column0.x = cos;
			m.column0.y = num4;
			m.column0.z = -num3;
			m.column1.x = -num4;
			m.column1.y = cos;
			m.column1.z = num2;
			m.column2.x = num3;
			m.column2.y = -num2;
			m.column2.z = cos;
			float num5 = 1f - cos;
			float num6 = axis.x * num5;
			float num7 = axis.y * num5;
			float num8 = axis.z * num5;
			m.column0.x = m.column0.x + axis.x * num6;
			m.column0.y = m.column0.y + axis.y * num6;
			m.column0.z = m.column0.z + axis.z * num6;
			m.column1.x = m.column1.x + axis.x * num7;
			m.column1.y = m.column1.y + axis.y * num7;
			m.column1.z = m.column1.z + axis.z * num7;
			m.column2.x = m.column2.x + axis.x * num8;
			m.column2.y = m.column2.y + axis.y * num8;
			m.column2.z = m.column2.z + axis.z * num8;
		}

		// Token: 0x0600072E RID: 1838 RVA: 0x0003FA58 File Offset: 0x0003DC58
		public static void SAFBIKMatFastLerp(out FullBodyIK.Matrix3x3 ret, ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs, float rate)
		{
			if (rate <= 1E-07f)
			{
				ret = lhs;
				return;
			}
			if (rate >= 0.9999999f)
			{
				ret = rhs;
				return;
			}
			Vector3 vector = lhs.column0;
			Vector3 vector2 = lhs.column1;
			vector += (rhs.column0 - vector) * rate;
			vector2 += (rhs.column1 - vector2) * rate;
			Vector3 rhs2 = Vector3.Cross(vector, vector2);
			vector = Vector3.Cross(vector2, rhs2);
			if (FullBodyIK.SAFBIKVecNormalize3(ref vector, ref vector2, ref rhs2))
			{
				ret = FullBodyIK.Matrix3x3.FromColumn(ref vector, ref vector2, ref rhs2);
			}
			else
			{
				ret = lhs;
			}
		}

		// Token: 0x0600072F RID: 1839 RVA: 0x0003FB18 File Offset: 0x0003DD18
		public static void SAFBIKMatFastLerpToIdentity(ref FullBodyIK.Matrix3x3 m, float rate)
		{
			if (rate > 1E-07f)
			{
				if (rate >= 0.9999999f)
				{
					m = FullBodyIK.Matrix3x3.identity;
				}
				else
				{
					Vector3 vector = m.column0;
					Vector3 vector2 = m.column1;
					vector += (new Vector3(1f, 0f, 0f) - vector) * rate;
					vector2 += (new Vector3(0f, 1f, 0f) - vector2) * rate;
					Vector3 rhs = Vector3.Cross(vector, vector2);
					vector = Vector3.Cross(vector2, rhs);
					if (FullBodyIK.SAFBIKVecNormalize3(ref vector, ref vector2, ref rhs))
					{
						m = FullBodyIK.Matrix3x3.FromColumn(ref vector, ref vector2, ref rhs);
					}
				}
			}
		}

		// Token: 0x06000730 RID: 1840 RVA: 0x0003FBE0 File Offset: 0x0003DDE0
		public static void SAFBIKMatMultVecInv(out Vector3 ret, ref FullBodyIK.Matrix3x3 mat, ref Vector3 vec)
		{
			FullBodyIK.Matrix3x3 transpose = mat.transpose;
			FullBodyIK.SAFBIKMatMultVec(out ret, ref transpose, ref vec);
		}

		// Token: 0x06000731 RID: 1841 RVA: 0x0003FBFD File Offset: 0x0003DDFD
		public static void SAFBIKMatMultVecAdd(out Vector3 ret, ref FullBodyIK.Matrix3x3 mat, ref Vector3 vec, ref Vector3 addVec)
		{
			FullBodyIK.SAFBIKMatMultVec(out ret, ref mat, ref vec);
			ret += addVec;
		}

		// Token: 0x06000732 RID: 1842 RVA: 0x0003FC20 File Offset: 0x0003DE20
		public static void SAFBIKMatMultVecPreSub(out Vector3 ret, ref FullBodyIK.Matrix3x3 mat, ref Vector3 vec, ref Vector3 subVec)
		{
			Vector3 vector = vec - subVec;
			FullBodyIK.SAFBIKMatMultVec(out ret, ref mat, ref vector);
		}

		// Token: 0x06000733 RID: 1843 RVA: 0x0003FC48 File Offset: 0x0003DE48
		public static void SAFBIKMatMultVecPreSubAdd(out Vector3 ret, ref FullBodyIK.Matrix3x3 mat, ref Vector3 vec, ref Vector3 subVec, ref Vector3 addVec)
		{
			Vector3 vector = vec - subVec;
			FullBodyIK.SAFBIKMatMultVec(out ret, ref mat, ref vector);
			ret += addVec;
		}

		// Token: 0x06000734 RID: 1844 RVA: 0x0003FC88 File Offset: 0x0003DE88
		public static void SAFBIKMatMultInv0(out FullBodyIK.Matrix3x3 ret, ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs)
		{
			ret = new FullBodyIK.Matrix3x3(lhs.column0.x * rhs.column0.x + lhs.column0.y * rhs.column0.y + lhs.column0.z * rhs.column0.z, lhs.column0.x * rhs.column1.x + lhs.column0.y * rhs.column1.y + lhs.column0.z * rhs.column1.z, lhs.column0.x * rhs.column2.x + lhs.column0.y * rhs.column2.y + lhs.column0.z * rhs.column2.z, lhs.column1.x * rhs.column0.x + lhs.column1.y * rhs.column0.y + lhs.column1.z * rhs.column0.z, lhs.column1.x * rhs.column1.x + lhs.column1.y * rhs.column1.y + lhs.column1.z * rhs.column1.z, lhs.column1.x * rhs.column2.x + lhs.column1.y * rhs.column2.y + lhs.column1.z * rhs.column2.z, lhs.column2.x * rhs.column0.x + lhs.column2.y * rhs.column0.y + lhs.column2.z * rhs.column0.z, lhs.column2.x * rhs.column1.x + lhs.column2.y * rhs.column1.y + lhs.column2.z * rhs.column1.z, lhs.column2.x * rhs.column2.x + lhs.column2.y * rhs.column2.y + lhs.column2.z * rhs.column2.z);
		}

		// Token: 0x06000735 RID: 1845 RVA: 0x0003FF1C File Offset: 0x0003E11C
		public static void SAFBIKMatMultInv1(out FullBodyIK.Matrix3x3 ret, ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs)
		{
			ret = new FullBodyIK.Matrix3x3(lhs.column0.x * rhs.column0.x + lhs.column1.x * rhs.column1.x + lhs.column2.x * rhs.column2.x, lhs.column0.x * rhs.column0.y + lhs.column1.x * rhs.column1.y + lhs.column2.x * rhs.column2.y, lhs.column0.x * rhs.column0.z + lhs.column1.x * rhs.column1.z + lhs.column2.x * rhs.column2.z, lhs.column0.y * rhs.column0.x + lhs.column1.y * rhs.column1.x + lhs.column2.y * rhs.column2.x, lhs.column0.y * rhs.column0.y + lhs.column1.y * rhs.column1.y + lhs.column2.y * rhs.column2.y, lhs.column0.y * rhs.column0.z + lhs.column1.y * rhs.column1.z + lhs.column2.y * rhs.column2.z, lhs.column0.z * rhs.column0.x + lhs.column1.z * rhs.column1.x + lhs.column2.z * rhs.column2.x, lhs.column0.z * rhs.column0.y + lhs.column1.z * rhs.column1.y + lhs.column2.z * rhs.column2.y, lhs.column0.z * rhs.column0.z + lhs.column1.z * rhs.column1.z + lhs.column2.z * rhs.column2.z);
		}

		// Token: 0x06000736 RID: 1846 RVA: 0x000401B0 File Offset: 0x0003E3B0
		public static void SAFBIKMatMultGetRot(out Quaternion ret, ref FullBodyIK.Matrix3x3 lhs, ref FullBodyIK.Matrix3x3 rhs)
		{
			FullBodyIK.Matrix3x3 matrix3x;
			FullBodyIK.SAFBIKMatMult(out matrix3x, ref lhs, ref rhs);
			FullBodyIK.SAFBIKMatGetRot(out ret, ref matrix3x);
		}

		// Token: 0x06000737 RID: 1847 RVA: 0x000401D0 File Offset: 0x0003E3D0
		public static void SAFBIKMatSetRotMult(out FullBodyIK.Matrix3x3 ret, ref Quaternion lhs, ref Quaternion rhs)
		{
			Quaternion quaternion = lhs * rhs;
			FullBodyIK.SAFBIKMatSetRot(out ret, ref quaternion);
		}

		// Token: 0x06000738 RID: 1848 RVA: 0x000401F8 File Offset: 0x0003E3F8
		public static void SAFBIKMatSetRotMultInv1(out FullBodyIK.Matrix3x3 ret, ref Quaternion lhs, ref Quaternion rhs)
		{
			Quaternion quaternion = lhs * FullBodyIK.Inverse(rhs);
			FullBodyIK.SAFBIKMatSetRot(out ret, ref quaternion);
		}

		// Token: 0x06000739 RID: 1849 RVA: 0x00040224 File Offset: 0x0003E424
		public static void SAFBIKQuatMult(out Quaternion ret, ref Quaternion q0, ref Quaternion q1)
		{
			ret = q0 * q1;
		}

		// Token: 0x0600073A RID: 1850 RVA: 0x0004023D File Offset: 0x0003E43D
		public static void SAFBIKQuatMultInv0(out Quaternion ret, ref Quaternion q0, ref Quaternion q1)
		{
			ret = FullBodyIK.Inverse(q0) * q1;
		}

		// Token: 0x0600073B RID: 1851 RVA: 0x0004025B File Offset: 0x0003E45B
		public static void SAFBIKQuatMultNorm(out Quaternion ret, ref Quaternion q0, ref Quaternion q1)
		{
			ret = FullBodyIK.Normalize(q0 * q1);
		}

		// Token: 0x0600073C RID: 1852 RVA: 0x00040279 File Offset: 0x0003E479
		public static void SAFBIKQuatMultNormInv0(out Quaternion ret, ref Quaternion q0, ref Quaternion q1)
		{
			ret = FullBodyIK.Normalize(FullBodyIK.Inverse(q0) * q1);
		}

		// Token: 0x0600073D RID: 1853 RVA: 0x0004029C File Offset: 0x0003E49C
		public static void SAFBIKQuatMult3(out Quaternion ret, ref Quaternion q0, ref Quaternion q1, ref Quaternion q2)
		{
			ret = q0 * q1 * q2;
		}

		// Token: 0x0600073E RID: 1854 RVA: 0x000402C0 File Offset: 0x0003E4C0
		public static void SAFBIKQuatMult3Inv0(out Quaternion ret, ref Quaternion q0, ref Quaternion q1, ref Quaternion q2)
		{
			ret = FullBodyIK.Inverse(q0) * q1 * q2;
		}

		// Token: 0x0600073F RID: 1855 RVA: 0x000402E9 File Offset: 0x0003E4E9
		public static void SAFBIKQuatMult3Inv1(out Quaternion ret, ref Quaternion q0, ref Quaternion q1, ref Quaternion q2)
		{
			ret = q0 * FullBodyIK.Inverse(q1) * q2;
		}

		// Token: 0x06000740 RID: 1856 RVA: 0x00040312 File Offset: 0x0003E512
		public static void SAFBIKQuatMultNorm3(out Quaternion ret, ref Quaternion q0, ref Quaternion q1, ref Quaternion q2)
		{
			ret = FullBodyIK.Normalize(q0 * q1 * q2);
		}

		// Token: 0x06000741 RID: 1857 RVA: 0x0004033B File Offset: 0x0003E53B
		public static void SAFBIKQuatMultNorm3Inv0(out Quaternion ret, ref Quaternion q0, ref Quaternion q1, ref Quaternion q2)
		{
			ret = FullBodyIK.Normalize(FullBodyIK.Inverse(q0) * q1 * q2);
		}

		// Token: 0x06000742 RID: 1858 RVA: 0x00040369 File Offset: 0x0003E569
		public static void SAFBIKQuatMultNorm3Inv1(out Quaternion ret, ref Quaternion q0, ref Quaternion q1, ref Quaternion q2)
		{
			ret = FullBodyIK.Normalize(q0 * FullBodyIK.Inverse(q1) * q2);
		}

		// Token: 0x06000743 RID: 1859 RVA: 0x00040398 File Offset: 0x0003E598
		public static bool SAFBIKComputeBasisFromXZLockX(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirX, ref Vector3 dirZ)
		{
			Vector3 rhs = Vector3.Cross(dirZ, dirX);
			Vector3 vector = Vector3.Cross(dirX, rhs);
			if (FullBodyIK.SAFBIKVecNormalize2(ref rhs, ref vector))
			{
				basis = FullBodyIK.Matrix3x3.FromColumn(ref dirX, ref rhs, ref vector);
				return true;
			}
			basis = FullBodyIK.Matrix3x3.identity;
			return false;
		}

		// Token: 0x06000744 RID: 1860 RVA: 0x000403F0 File Offset: 0x0003E5F0
		public static bool SAFBIKComputeBasisFromXYLockX(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirX, ref Vector3 dirY)
		{
			Vector3 lhs = Vector3.Cross(dirX, dirY);
			Vector3 vector = Vector3.Cross(lhs, dirX);
			if (FullBodyIK.SAFBIKVecNormalize2(ref vector, ref lhs))
			{
				basis = FullBodyIK.Matrix3x3.FromColumn(ref dirX, ref vector, ref lhs);
				return true;
			}
			basis = FullBodyIK.Matrix3x3.identity;
			return false;
		}

		// Token: 0x06000745 RID: 1861 RVA: 0x00040448 File Offset: 0x0003E648
		public static bool SAFBIKComputeBasisFromXYLockY(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirX, ref Vector3 dirY)
		{
			Vector3 rhs = Vector3.Cross(dirX, dirY);
			Vector3 vector = Vector3.Cross(dirY, rhs);
			if (FullBodyIK.SAFBIKVecNormalize2(ref vector, ref rhs))
			{
				basis = FullBodyIK.Matrix3x3.FromColumn(ref vector, ref dirY, ref rhs);
				return true;
			}
			basis = FullBodyIK.Matrix3x3.identity;
			return false;
		}

		// Token: 0x06000746 RID: 1862 RVA: 0x000404A0 File Offset: 0x0003E6A0
		public static bool SAFBIKComputeBasisFromXZLockZ(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirX, ref Vector3 dirZ)
		{
			Vector3 lhs = Vector3.Cross(dirZ, dirX);
			Vector3 vector = Vector3.Cross(lhs, dirZ);
			if (FullBodyIK.SAFBIKVecNormalize2(ref vector, ref lhs))
			{
				basis = FullBodyIK.Matrix3x3.FromColumn(ref vector, ref lhs, ref dirZ);
				return true;
			}
			basis = FullBodyIK.Matrix3x3.identity;
			return false;
		}

		// Token: 0x06000747 RID: 1863 RVA: 0x000404F8 File Offset: 0x0003E6F8
		public static bool SAFBIKComputeBasisFromYZLockY(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirY, ref Vector3 dirZ)
		{
			Vector3 lhs = Vector3.Cross(dirY, dirZ);
			Vector3 vector = Vector3.Cross(lhs, dirY);
			if (FullBodyIK.SAFBIKVecNormalize2(ref lhs, ref vector))
			{
				basis = FullBodyIK.Matrix3x3.FromColumn(ref lhs, ref dirY, ref vector);
				return true;
			}
			basis = FullBodyIK.Matrix3x3.identity;
			return false;
		}

		// Token: 0x06000748 RID: 1864 RVA: 0x00040550 File Offset: 0x0003E750
		public static bool SAFBIKComputeBasisFromYZLockZ(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirY, ref Vector3 dirZ)
		{
			Vector3 rhs = Vector3.Cross(dirY, dirZ);
			Vector3 vector = Vector3.Cross(dirZ, rhs);
			if (FullBodyIK.SAFBIKVecNormalize2(ref rhs, ref vector))
			{
				basis = FullBodyIK.Matrix3x3.FromColumn(ref rhs, ref vector, ref dirZ);
				return true;
			}
			basis = FullBodyIK.Matrix3x3.identity;
			return false;
		}

		// Token: 0x06000749 RID: 1865 RVA: 0x000405A8 File Offset: 0x0003E7A8
		public static bool SAFBIKComputeBasisLockX(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirX, ref Vector3 dirY, ref Vector3 dirZ)
		{
			FullBodyIK.Matrix3x3 matrix3x;
			bool flag = FullBodyIK.SAFBIKComputeBasisFromXYLockX(out matrix3x, ref dirX, ref dirY);
			FullBodyIK.Matrix3x3 matrix3x2;
			bool flag2 = FullBodyIK.SAFBIKComputeBasisFromXZLockX(out matrix3x2, ref dirX, ref dirZ);
			if (flag && flag2)
			{
				float num = Mathf.Abs(Vector3.Dot(dirX, dirY));
				float num2 = Mathf.Abs(Vector3.Dot(dirX, dirZ));
				if (num2 <= 1E-07f)
				{
					basis = matrix3x2;
					return true;
				}
				if (num <= 1E-07f)
				{
					basis = matrix3x;
					return true;
				}
				FullBodyIK.SAFBIKMatFastLerp(out basis, ref matrix3x, ref matrix3x2, num / (num + num2));
				return true;
			}
			else
			{
				if (flag)
				{
					basis = matrix3x;
					return true;
				}
				if (flag2)
				{
					basis = matrix3x2;
					return true;
				}
				basis = FullBodyIK.Matrix3x3.identity;
				return false;
			}
		}

		// Token: 0x0600074A RID: 1866 RVA: 0x00040670 File Offset: 0x0003E870
		public static bool SAFBIKComputeBasisLockY(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirX, ref Vector3 dirY, ref Vector3 dirZ)
		{
			FullBodyIK.Matrix3x3 matrix3x;
			bool flag = FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x, ref dirX, ref dirY);
			FullBodyIK.Matrix3x3 matrix3x2;
			bool flag2 = FullBodyIK.SAFBIKComputeBasisFromYZLockY(out matrix3x2, ref dirY, ref dirZ);
			if (flag && flag2)
			{
				float num = Mathf.Abs(Vector3.Dot(dirY, dirX));
				float num2 = Mathf.Abs(Vector3.Dot(dirY, dirZ));
				if (num2 <= 1E-07f)
				{
					basis = matrix3x2;
					return true;
				}
				if (num <= 1E-07f)
				{
					basis = matrix3x;
					return true;
				}
				FullBodyIK.SAFBIKMatFastLerp(out basis, ref matrix3x, ref matrix3x2, num / (num + num2));
				return true;
			}
			else
			{
				if (flag)
				{
					basis = matrix3x;
					return true;
				}
				if (flag2)
				{
					basis = matrix3x2;
					return true;
				}
				basis = FullBodyIK.Matrix3x3.identity;
				return false;
			}
		}

		// Token: 0x0600074B RID: 1867 RVA: 0x00040738 File Offset: 0x0003E938
		public static bool SAFBIKComputeBasisLockZ(out FullBodyIK.Matrix3x3 basis, ref Vector3 dirX, ref Vector3 dirY, ref Vector3 dirZ)
		{
			FullBodyIK.Matrix3x3 matrix3x;
			bool flag = FullBodyIK.SAFBIKComputeBasisFromXZLockZ(out matrix3x, ref dirX, ref dirZ);
			FullBodyIK.Matrix3x3 matrix3x2;
			bool flag2 = FullBodyIK.SAFBIKComputeBasisFromYZLockZ(out matrix3x2, ref dirY, ref dirZ);
			if (flag && flag2)
			{
				float num = Mathf.Abs(Vector3.Dot(dirZ, dirX));
				float num2 = Mathf.Abs(Vector3.Dot(dirZ, dirY));
				if (num2 <= 1E-07f)
				{
					basis = matrix3x2;
					return true;
				}
				if (num <= 1E-07f)
				{
					basis = matrix3x;
					return true;
				}
				FullBodyIK.SAFBIKMatFastLerp(out basis, ref matrix3x, ref matrix3x2, num / (num + num2));
				return true;
			}
			else
			{
				if (flag)
				{
					basis = matrix3x;
					return true;
				}
				if (flag2)
				{
					basis = matrix3x2;
					return true;
				}
				basis = FullBodyIK.Matrix3x3.identity;
				return false;
			}
		}

		// Token: 0x0600074C RID: 1868 RVA: 0x00040800 File Offset: 0x0003EA00
		public static bool IsFuzzy(float lhs, float rhs, float epsilon = 1E-07f)
		{
			float num = lhs - rhs;
			return num >= -epsilon && num <= epsilon;
		}

		// Token: 0x0600074D RID: 1869 RVA: 0x00040824 File Offset: 0x0003EA24
		public static bool IsFuzzy(Vector3 lhs, Vector3 rhs, float epsilon = 1E-07f)
		{
			float num = lhs.x - rhs.x;
			if (num >= -epsilon && num <= epsilon)
			{
				num = lhs.y - rhs.y;
				if (num >= -epsilon && num <= epsilon)
				{
					num = lhs.z - rhs.z;
					if (num >= -epsilon && num <= epsilon)
					{
						return true;
					}
				}
			}
			return false;
		}

		// Token: 0x0600074E RID: 1870 RVA: 0x00040894 File Offset: 0x0003EA94
		public static bool IsFuzzy(ref Vector3 lhs, ref Vector3 rhs, float epsilon = 1E-07f)
		{
			float num = lhs.x - rhs.x;
			if (num >= -epsilon && num <= epsilon)
			{
				num = lhs.y - rhs.y;
				if (num >= -epsilon && num <= epsilon)
				{
					num = lhs.z - rhs.z;
					if (num >= -epsilon && num <= epsilon)
					{
						return true;
					}
				}
			}
			return false;
		}

		// Token: 0x0600074F RID: 1871 RVA: 0x000408FB File Offset: 0x0003EAFB
		public static bool _IsNear(ref Vector3 lhs, ref Vector3 rhs)
		{
			return FullBodyIK.IsFuzzy(ref lhs, ref rhs, 1E-05f);
		}

		// Token: 0x06000750 RID: 1872 RVA: 0x00040909 File Offset: 0x0003EB09
		public static Vector3 _Rotate(ref Vector3 dirX, ref Vector3 dirY, float cosR, float sinR)
		{
			return dirX * cosR + dirY * sinR;
		}

		// Token: 0x06000751 RID: 1873 RVA: 0x00040928 File Offset: 0x0003EB28
		public static Vector3 _Rotate(ref Vector3 dirX, ref Vector3 dirY, float r)
		{
			float d = Mathf.Cos(r);
			float d2 = Mathf.Sin(r);
			return dirX * d + dirY * d2;
		}

		// Token: 0x06000752 RID: 1874 RVA: 0x00040960 File Offset: 0x0003EB60
		public static Vector3 _Rotate(ref Vector3 dirX, ref Vector3 dirY, ref FullBodyIK.FastAngle angle)
		{
			return dirX * angle.cos + dirY * angle.sin;
		}

		// Token: 0x06000753 RID: 1875 RVA: 0x0004098C File Offset: 0x0003EB8C
		public static bool _NormalizedTranslate(ref Vector3 dir, ref Vector3 fr, ref Vector3 to)
		{
			Vector3 a = to - fr;
			float magnitude = a.magnitude;
			if (magnitude > 1E-07f)
			{
				dir = a * (1f / magnitude);
				return true;
			}
			dir = Vector3.zero;
			return false;
		}

		// Token: 0x06000754 RID: 1876 RVA: 0x0001587A File Offset: 0x00013A7A
		public static Quaternion Inverse(Quaternion q)
		{
			return new Quaternion(-q.x, -q.y, -q.z, q.w);
		}

		// Token: 0x06000755 RID: 1877 RVA: 0x000409E0 File Offset: 0x0003EBE0
		public static Quaternion Normalize(Quaternion q)
		{
			float num = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w;
			if (num <= 1E-07f)
			{
				return q;
			}
			if (num >= 0.9999999f && (double)num <= 1.0000001000000012)
			{
				return q;
			}
			float num2 = 1f / Mathf.Sqrt(num);
			return new Quaternion(q.x * num2, q.y * num2, q.z * num2, q.w * num2);
		}

		// Token: 0x06000756 RID: 1878 RVA: 0x00040A90 File Offset: 0x0003EC90
		public static bool SafeNormalize(ref Quaternion q)
		{
			float num = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w;
			if (num <= 1E-07f)
			{
				return false;
			}
			if (num >= 0.9999999f && (double)num <= 1.0000001000000012)
			{
				return true;
			}
			float num2 = 1f / Mathf.Sqrt(num);
			q.x *= num2;
			q.y *= num2;
			q.z *= num2;
			q.w *= num2;
			return true;
		}

		// Token: 0x06000757 RID: 1879 RVA: 0x00040B45 File Offset: 0x0003ED45
		public static bool IsFuzzyIdentity(Quaternion q)
		{
			return FullBodyIK.IsFuzzyIdentity(ref q);
		}

		// Token: 0x06000758 RID: 1880 RVA: 0x00040B50 File Offset: 0x0003ED50
		public static bool IsFuzzyIdentity(ref Quaternion q)
		{
			return q.x >= -1E-07f && q.x <= 1E-07f && q.y >= -1E-07f && q.y <= 1E-07f && q.z >= -1E-07f && q.z <= 1E-07f && q.w >= 0.9999999f && q.w <= 1.0000001f;
		}

		// Token: 0x06000759 RID: 1881 RVA: 0x00040BE0 File Offset: 0x0003EDE0
		public static bool SAFBIKComputeBasisFromXZLockX(out FullBodyIK.Matrix3x3 basis, Vector3 dirX, Vector3 dirZ)
		{
			return FullBodyIK.SAFBIKComputeBasisFromXZLockX(out basis, ref dirX, ref dirZ);
		}

		// Token: 0x0600075A RID: 1882 RVA: 0x00040BEC File Offset: 0x0003EDEC
		public static bool SAFBIKComputeBasisFromXYLockX(out FullBodyIK.Matrix3x3 basis, Vector3 dirX, Vector3 dirY)
		{
			return FullBodyIK.SAFBIKComputeBasisFromXYLockX(out basis, ref dirX, ref dirY);
		}

		// Token: 0x0600075B RID: 1883 RVA: 0x00040BF8 File Offset: 0x0003EDF8
		public static bool SAFBIKComputeBasisFromXYLockY(out FullBodyIK.Matrix3x3 basis, Vector3 dirX, Vector3 dirY)
		{
			return FullBodyIK.SAFBIKComputeBasisFromXYLockY(out basis, ref dirX, ref dirY);
		}

		// Token: 0x0600075C RID: 1884 RVA: 0x00040C04 File Offset: 0x0003EE04
		public static bool SAFBIKComputeBasisFromXZLockZ(out FullBodyIK.Matrix3x3 basis, Vector3 dirX, Vector3 dirZ)
		{
			return FullBodyIK.SAFBIKComputeBasisFromXZLockZ(out basis, ref dirX, ref dirZ);
		}

		// Token: 0x0600075D RID: 1885 RVA: 0x00040C10 File Offset: 0x0003EE10
		public static bool SAFBIKComputeBasisFromYZLockY(out FullBodyIK.Matrix3x3 basis, Vector3 dirY, Vector3 dirZ)
		{
			return FullBodyIK.SAFBIKComputeBasisFromYZLockY(out basis, ref dirY, ref dirZ);
		}

		// Token: 0x0600075E RID: 1886 RVA: 0x00040C1C File Offset: 0x0003EE1C
		public static bool SAFBIKComputeBasisFromYZLockZ(out FullBodyIK.Matrix3x3 basis, Vector3 dirY, Vector3 dirZ)
		{
			return FullBodyIK.SAFBIKComputeBasisFromYZLockZ(out basis, ref dirY, ref dirZ);
		}

		// Token: 0x0600075F RID: 1887 RVA: 0x00040C28 File Offset: 0x0003EE28
		public static bool SAFBIKComputeBasisFrom(out FullBodyIK.Matrix3x3 basis, ref FullBodyIK.Matrix3x3 rootBasis, ref Vector3 dir, FullBodyIK._DirectionAs directionAs)
		{
			switch (directionAs)
			{
			case FullBodyIK._DirectionAs.XPlus:
				return FullBodyIK.SAFBIKComputeBasisFromXYLockX(out basis, dir, rootBasis.column1);
			case FullBodyIK._DirectionAs.XMinus:
				return FullBodyIK.SAFBIKComputeBasisFromXYLockX(out basis, -dir, rootBasis.column1);
			case FullBodyIK._DirectionAs.YPlus:
				return FullBodyIK.SAFBIKComputeBasisFromXYLockY(out basis, rootBasis.column0, dir);
			case FullBodyIK._DirectionAs.YMinus:
				return FullBodyIK.SAFBIKComputeBasisFromXYLockY(out basis, rootBasis.column0, -dir);
			default:
				basis = FullBodyIK.Matrix3x3.identity;
				return false;
			}
		}

		// Token: 0x06000760 RID: 1888 RVA: 0x00040CB4 File Offset: 0x0003EEB4
		public static float ComputeCosTheta(float lenASq, float lenBSq, float lenCSq, float lenB, float lenC)
		{
			float num = lenB * lenC * 2f;
			if (num > 1E-07f)
			{
				return (lenBSq + lenCSq - lenASq) / num;
			}
			return 1f;
		}

		// Token: 0x06000761 RID: 1889 RVA: 0x00040CE4 File Offset: 0x0003EEE4
		public static float ComputeCosTheta(FullBodyIK.FastLength lenA, FullBodyIK.FastLength lenB, FullBodyIK.FastLength lenC)
		{
			float num = lenB.length * lenC.length * 2f;
			if (num > 1E-07f)
			{
				return (lenB.lengthSq + lenC.lengthSq - lenA.lengthSq) / num;
			}
			return 0f;
		}

		// Token: 0x06000762 RID: 1890 RVA: 0x00040D34 File Offset: 0x0003EF34
		public static float ComputeSinTheta(float lenASq, float lenBSq, float lenCSq, float lenB, float lenC)
		{
			float num = lenB * lenC * 2f;
			if (num > 1E-07f)
			{
				float num2 = (lenBSq + lenCSq - lenASq) / num;
				return FullBodyIK.SAFBIKSqrtClamp01(1f - num2 * num2);
			}
			return 0f;
		}

		// Token: 0x06000763 RID: 1891 RVA: 0x00040D74 File Offset: 0x0003EF74
		public static float ComputeSinTheta(FullBodyIK.FastLength lenA, FullBodyIK.FastLength lenB, FullBodyIK.FastLength lenC)
		{
			float num = lenB.length * lenC.length * 2f;
			if (num > 1E-07f)
			{
				float num2 = (lenB.lengthSq + lenC.lengthSq - lenA.lengthSq) / num;
				return FullBodyIK.SAFBIKSqrtClamp01(1f - num2 * num2);
			}
			return 0f;
		}

		// Token: 0x06000764 RID: 1892 RVA: 0x00040DD0 File Offset: 0x0003EFD0
		private static bool _ComputeThetaAxis(ref Vector3 origPos, ref Vector3 fromPos, ref Vector3 toPos, out float theta, out Vector3 axis)
		{
			Vector3 vector = fromPos - origPos;
			Vector3 vector2 = toPos - origPos;
			if (!FullBodyIK.SAFBIKVecNormalize2(ref vector, ref vector2))
			{
				theta = 0f;
				axis = new Vector3(0f, 0f, 1f);
				return false;
			}
			return FullBodyIK._ComputeThetaAxis(ref vector, ref vector2, out theta, out axis);
		}

		// Token: 0x06000765 RID: 1893 RVA: 0x00040E3C File Offset: 0x0003F03C
		private static bool _ComputeThetaAxis(ref Vector3 dirFrom, ref Vector3 dirTo, out float theta, out Vector3 axis)
		{
			axis = Vector3.Cross(dirFrom, dirTo);
			if (!FullBodyIK.SAFBIKVecNormalize(ref axis))
			{
				theta = 0f;
				axis = new Vector3(0f, 0f, 1f);
				return false;
			}
			theta = Vector3.Dot(dirFrom, dirTo);
			return true;
		}

		// Token: 0x06000766 RID: 1894 RVA: 0x00040E9D File Offset: 0x0003F09D
		public static Vector3 Scale(Vector3 lhs, Vector3 rhs)
		{
			return new Vector3(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z);
		}

		// Token: 0x06000767 RID: 1895 RVA: 0x00040ED1 File Offset: 0x0003F0D1
		public static Vector3 Scale(ref Vector3 lhs, ref Vector3 rhs)
		{
			return new Vector3(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z);
		}

		// Token: 0x06000768 RID: 1896 RVA: 0x00040F00 File Offset: 0x0003F100
		public static bool _LimitXY_Square(ref Vector3 dir, float limitXMinus, float limitXPlus, float limitYMinus, float limitYPlus)
		{
			bool flag = false;
			bool flag2 = false;
			if (dir.x < -limitXMinus)
			{
				dir.x = -limitXMinus;
				flag = true;
			}
			else if (dir.x > limitXPlus)
			{
				dir.x = limitXPlus;
				flag = true;
			}
			if (dir.y < -limitYMinus)
			{
				dir.y = -limitYMinus;
				flag2 = true;
			}
			else if (dir.y > limitYPlus)
			{
				dir.y = limitYPlus;
				flag2 = true;
			}
			if (flag || flag2)
			{
				dir.z = FullBodyIK.SAFBIKSqrt(1f - (dir.x * dir.x + dir.y * dir.y));
				return true;
			}
			if (dir.z < 0f)
			{
				dir.z = -dir.z;
				return true;
			}
			return false;
		}

		// Token: 0x06000769 RID: 1897 RVA: 0x00040FD0 File Offset: 0x0003F1D0
		public static bool _LimitYZ_Square(bool isRight, ref Vector3 dir, float limitYMinus, float limitYPlus, float limitZMinus, float limitZPlus)
		{
			bool flag = false;
			bool flag2 = false;
			if (dir.y < -limitYMinus)
			{
				dir.y = -limitYMinus;
				flag = true;
			}
			else if (dir.y > limitYPlus)
			{
				dir.y = limitYPlus;
				flag = true;
			}
			if (dir.z < -limitZMinus)
			{
				dir.z = -limitZMinus;
				flag2 = true;
			}
			else if (dir.z > limitZPlus)
			{
				dir.z = limitZPlus;
				flag2 = true;
			}
			if (flag || flag2)
			{
				dir.x = FullBodyIK.SAFBIKSqrt(1f - (dir.y * dir.y + dir.z * dir.z));
				if (!isRight)
				{
					dir.x = -dir.x;
				}
				return true;
			}
			if (isRight)
			{
				if (dir.x < 0f)
				{
					dir.x = -dir.x;
					return true;
				}
			}
			else if (dir.x >= 0f)
			{
				dir.x = -dir.x;
				return true;
			}
			return false;
		}

		// Token: 0x0600076A RID: 1898 RVA: 0x000410E0 File Offset: 0x0003F2E0
		public static bool _LimitXZ_Square(ref Vector3 dir, float limitXMinus, float limitXPlus, float limitZMinus, float limitZPlus)
		{
			bool flag = false;
			bool flag2 = false;
			if (dir.x < -limitXMinus)
			{
				dir.x = -limitXMinus;
				flag = true;
			}
			else if (dir.x > limitXPlus)
			{
				dir.x = limitXPlus;
				flag = true;
			}
			if (dir.z < -limitZMinus)
			{
				dir.z = -limitZMinus;
				flag2 = true;
			}
			else if (dir.z > limitZPlus)
			{
				dir.z = limitZPlus;
				flag2 = true;
			}
			if (flag || flag2)
			{
				dir.y = FullBodyIK.SAFBIKSqrt(1f - (dir.x * dir.x + dir.z * dir.z));
				return true;
			}
			if (dir.y < 0f)
			{
				dir.y = -dir.y;
				return true;
			}
			return false;
		}

		// Token: 0x0600076B RID: 1899 RVA: 0x000411B0 File Offset: 0x0003F3B0
		public static bool _LimitXY(ref Vector3 dir, float limitXMinus, float limitXPlus, float limitYMinus, float limitYPlus)
		{
			bool flag = dir.x >= 0f;
			bool flag2 = dir.y >= 0f;
			float num = (!flag) ? limitXMinus : limitXPlus;
			float num2 = (!flag2) ? limitYMinus : limitYPlus;
			bool flag3 = false;
			if (num <= 1E-07f && num2 <= 1E-07f)
			{
				Vector3 vector = new Vector3(0f, 0f, 1f);
				Vector3 vector2 = vector - dir;
				if (Mathf.Abs(vector2.x) > 1E-07f || Mathf.Abs(vector2.y) > 1E-07f || Mathf.Abs(vector2.z) > 1E-07f)
				{
					dir = vector;
					flag3 = true;
				}
			}
			else
			{
				float num3 = (num < 1E-07f) ? 0f : (1f / num);
				float num4 = (num2 < 1E-07f) ? 0f : (1f / num2);
				float num5 = dir.x * num3;
				float num6 = dir.y * num4;
				float num7 = FullBodyIK.SAFBIKSqrt(num5 * num5 + num6 * num6 + dir.z * dir.z);
				float num8 = (num7 <= 1E-07f) ? 0f : (1f / num7);
				float num9 = num5 * num8;
				float num10 = num6 * num8;
				if (num7 > 1f && !flag3)
				{
					flag3 = true;
					num5 = num9;
					num6 = num10;
				}
				float num11 = (!flag3) ? dir.x : (num5 * num);
				float num12 = (!flag3) ? dir.y : (num6 * num2);
				bool flag4 = dir.z < 0f;
				if (flag3)
				{
					float a = num11 * num11 + num12 * num12;
					float num13 = FullBodyIK.SAFBIKSqrt(a);
					float z = FullBodyIK.SAFBIKSqrt(1f - num13 * num13);
					dir.x = num11;
					dir.y = num12;
					dir.z = z;
				}
				else if (flag4)
				{
					flag3 = true;
					dir.z = -dir.z;
				}
			}
			return flag3;
		}

		// Token: 0x0600076C RID: 1900 RVA: 0x000413F0 File Offset: 0x0003F5F0
		public static bool _LimitXZ(ref Vector3 dir, float limiXMinus, float limiXPlus, float limiZMinus, float limiZPlus)
		{
			bool flag = dir.x >= 0f;
			bool flag2 = dir.z >= 0f;
			float num = (!flag) ? limiXMinus : limiXPlus;
			float num2 = (!flag2) ? limiZMinus : limiZPlus;
			bool flag3 = false;
			if (num <= 1E-07f && num2 <= 1E-07f)
			{
				Vector3 vector = new Vector3(0f, 1f, 0f);
				Vector3 vector2 = vector - dir;
				if (Mathf.Abs(vector2.x) > 1E-07f || Mathf.Abs(vector2.y) > 1E-07f || Mathf.Abs(vector2.z) > 1E-07f)
				{
					dir = vector;
					flag3 = true;
				}
			}
			else
			{
				float num3 = (num < 1E-07f) ? 0f : (1f / num);
				float num4 = (num2 < 1E-07f) ? 0f : (1f / num2);
				float num5 = dir.x * num3;
				float num6 = dir.z * num4;
				float num7 = FullBodyIK.SAFBIKSqrt(num5 * num5 + num6 * num6 + dir.y * dir.y);
				float num8 = (num7 <= 1E-07f) ? 0f : (1f / num7);
				float num9 = num5 * num8;
				float num10 = num6 * num8;
				if (num7 > 1f && !flag3)
				{
					flag3 = true;
					num5 = num9;
					num6 = num10;
				}
				float num11 = (!flag3) ? dir.x : (num5 * num);
				float num12 = (!flag3) ? dir.z : (num6 * num2);
				bool flag4 = dir.y < 0f;
				if (flag3)
				{
					float a = num11 * num11 + num12 * num12;
					float num13 = FullBodyIK.SAFBIKSqrt(a);
					float y = FullBodyIK.SAFBIKSqrt(1f - num13 * num13);
					dir.x = num11;
					dir.y = y;
					dir.z = num12;
				}
				else if (flag4)
				{
					flag3 = true;
					dir.y = -dir.y;
				}
			}
			return flag3;
		}

		// Token: 0x0600076D RID: 1901 RVA: 0x00041630 File Offset: 0x0003F830
		public static bool _LimitYZ(bool isRight, ref Vector3 dir, float limitYMinus, float limitYPlus, float limitZMinus, float limitZPlus)
		{
			bool flag = dir.y >= 0f;
			bool flag2 = dir.z >= 0f;
			float num = (!flag) ? limitYMinus : limitYPlus;
			float num2 = (!flag2) ? limitZMinus : limitZPlus;
			bool flag3 = false;
			if (num <= 1E-07f && num2 <= 1E-07f)
			{
				Vector3 vector = (!isRight) ? new Vector3(-1f, 0f, 0f) : new Vector3(1f, 0f, 0f);
				Vector3 vector2 = vector - dir;
				if (Mathf.Abs(vector2.x) > 1E-07f || Mathf.Abs(vector2.y) > 1E-07f || Mathf.Abs(vector2.z) > 1E-07f)
				{
					dir = vector;
					flag3 = true;
				}
			}
			else
			{
				float num3 = (num < 1E-07f) ? 0f : (1f / num);
				float num4 = (num2 < 1E-07f) ? 0f : (1f / num2);
				float num5 = dir.y * num3;
				float num6 = dir.z * num4;
				float num7 = FullBodyIK.SAFBIKSqrt(dir.x * dir.x + num5 * num5 + num6 * num6);
				float num8 = (num7 <= 1E-07f) ? 0f : (1f / num7);
				float num9 = num5 * num8;
				float num10 = num6 * num8;
				if (num7 > 1f && !flag3)
				{
					flag3 = true;
					num5 = num9;
					num6 = num10;
				}
				float num11 = (!flag3) ? dir.y : (num5 * num);
				float num12 = (!flag3) ? dir.z : (num6 * num2);
				bool flag4 = dir.x >= 0f != isRight;
				if (flag3)
				{
					float a = num11 * num11 + num12 * num12;
					float num13 = FullBodyIK.SAFBIKSqrt(a);
					float num14 = FullBodyIK.SAFBIKSqrt(1f - num13 * num13);
					dir.x = ((!isRight) ? (-num14) : num14);
					dir.y = num11;
					dir.z = num12;
				}
				else if (flag4)
				{
					flag3 = true;
					dir.x = -dir.x;
				}
			}
			return flag3;
		}

		// Token: 0x0600076E RID: 1902 RVA: 0x000418A8 File Offset: 0x0003FAA8
		public static Vector3 _FitToPlane(Vector3 pos, Vector3 planeDir)
		{
			float num = Vector3.Dot(pos, planeDir);
			if (num <= 1E-07f && num >= -1E-07f)
			{
				return pos;
			}
			return pos - planeDir * num;
		}

		// Token: 0x0600076F RID: 1903 RVA: 0x000418E4 File Offset: 0x0003FAE4
		public static bool _FitToPlaneDir(ref Vector3 dir, Vector3 planeDir)
		{
			float num = Vector3.Dot(dir, planeDir);
			if (num <= 1E-07f && num >= -1E-07f)
			{
				return false;
			}
			Vector3 vector = dir - planeDir * num;
			if (!FullBodyIK.SAFBIKVecNormalize(ref vector))
			{
				return false;
			}
			dir = vector;
			return true;
		}

		// Token: 0x06000770 RID: 1904 RVA: 0x00041940 File Offset: 0x0003FB40
		public static bool _LimitToPlaneDirY(ref Vector3 dir, Vector3 planeDir, float thetaY)
		{
			float num = Vector3.Dot(dir, planeDir);
			if (num <= 1E-07f && num >= -1E-07f)
			{
				return false;
			}
			if (num <= thetaY && num >= -thetaY)
			{
				return true;
			}
			Vector3 vector = dir - planeDir * num;
			float num2 = FullBodyIK.SAFBIKVecLength(ref vector);
			if (num2 <= 1E-45f)
			{
				return false;
			}
			float num3 = FullBodyIK.SAFBIKSqrt(1f - thetaY * thetaY);
			vector *= num3 / num2;
			dir = vector;
			if (num >= 0f)
			{
				dir += planeDir * thetaY;
			}
			else
			{
				dir -= planeDir * thetaY;
			}
			return true;
		}

		// Token: 0x06000771 RID: 1905 RVA: 0x00041A0C File Offset: 0x0003FC0C
		private static void _LerpRotateBasis(out FullBodyIK.Matrix3x3 basis, ref Vector3 axis, float cos, float rate)
		{
			if (rate <= 1E-07f)
			{
				basis = FullBodyIK.Matrix3x3.identity;
				return;
			}
			if (rate <= 0.9999999f)
			{
				float num = (cos < 0.9999999f) ? ((cos > -1.0000001f) ? ((float)Math.Acos((double)cos)) : 3.1415927f) : 0f;
				cos = (float)Math.Cos((double)(num * rate));
			}
			FullBodyIK.SAFBIKMatSetAxisAngle(out basis, ref axis, cos);
		}

		// Token: 0x06000772 RID: 1906 RVA: 0x00041A84 File Offset: 0x0003FC84
		public static Vector3 _LerpDir(ref Vector3 src, ref Vector3 dst, float r)
		{
			float cos;
			Vector3 vector;
			if (FullBodyIK._ComputeThetaAxis(ref src, ref dst, out cos, out vector))
			{
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK._LerpRotateBasis(out matrix3x, ref vector, cos, r);
				Vector3 result;
				FullBodyIK.SAFBIKMatMultVec(out result, ref matrix3x, ref src);
				return result;
			}
			return dst;
		}

		// Token: 0x06000773 RID: 1907 RVA: 0x00041AC0 File Offset: 0x0003FCC0
		public static Vector3 _FastLerpDir(ref Vector3 src, ref Vector3 dst, float r)
		{
			if (r <= 1E-07f)
			{
				return src;
			}
			if (r >= 0.9999999f)
			{
				return dst;
			}
			Vector3 a = src + (dst - src) * r;
			float magnitude = a.magnitude;
			if (magnitude > 1E-07f)
			{
				return a * (1f / magnitude);
			}
			return dst;
		}

		// Token: 0x06000774 RID: 1908 RVA: 0x00041B3C File Offset: 0x0003FD3C
		public static bool _LimitFingerNotThumb(bool isRight, ref Vector3 dir, ref FullBodyIK.FastAngle limitYPlus, ref FullBodyIK.FastAngle limitYMinus, ref FullBodyIK.FastAngle limitZ)
		{
			bool result = false;
			if (limitZ.cos > 1E-07f && (dir.z < -limitZ.sin || dir.z > limitZ.sin))
			{
				result = true;
				bool flag = dir.z >= 0f;
				float num = FullBodyIK.SAFBIKSqrt(dir.x * dir.x + dir.y * dir.y);
				if (limitZ.sin <= 1E-07f)
				{
					if (num > 1E-07f)
					{
						dir.z = 0f;
						dir *= 1f / num;
					}
					else
					{
						dir.Set((!isRight) ? (-limitZ.cos) : limitZ.cos, 0f, (!flag) ? (-limitZ.sin) : limitZ.sin);
					}
				}
				else
				{
					float num2 = limitZ.sin * num / limitZ.cos;
					dir.z = ((!flag) ? (-num2) : num2);
					float magnitude = dir.magnitude;
					if (magnitude > 1E-07f)
					{
						dir *= 1f / magnitude;
					}
					else
					{
						dir.Set((!isRight) ? (-limitZ.cos) : limitZ.cos, 0f, (!flag) ? (-limitZ.sin) : limitZ.sin);
					}
				}
			}
			bool flag2 = dir.y >= 0f;
			float num3 = (!flag2) ? limitYMinus.cos : limitYPlus.cos;
			if ((isRight && dir.x < num3) || (!isRight && dir.x > -num3))
			{
				float num4 = FullBodyIK.SAFBIKSqrt(1f - (num3 * num3 + dir.z * dir.z));
				dir.x = ((!isRight) ? (-num3) : num3);
				dir.y = ((!flag2) ? (-num4) : num4);
			}
			return result;
		}

		// Token: 0x06000775 RID: 1909 RVA: 0x00041D75 File Offset: 0x0003FF75
		public static FullBodyIK.LimbIKType ToLimbIKType(FullBodyIK.LimbIKLocation limbIKLocation)
		{
			switch (limbIKLocation)
			{
			case FullBodyIK.LimbIKLocation.LeftLeg:
				return FullBodyIK.LimbIKType.Leg;
			case FullBodyIK.LimbIKLocation.RightLeg:
				return FullBodyIK.LimbIKType.Leg;
			case FullBodyIK.LimbIKLocation.LeftArm:
				return FullBodyIK.LimbIKType.Arm;
			case FullBodyIK.LimbIKLocation.RightArm:
				return FullBodyIK.LimbIKType.Arm;
			default:
				return FullBodyIK.LimbIKType.Max;
			}
		}

		// Token: 0x06000776 RID: 1910 RVA: 0x00041D9B File Offset: 0x0003FF9B
		public static FullBodyIK.Side ToLimbIKSide(FullBodyIK.LimbIKLocation limbIKLocation)
		{
			switch (limbIKLocation)
			{
			case FullBodyIK.LimbIKLocation.LeftLeg:
				return FullBodyIK.Side.Left;
			case FullBodyIK.LimbIKLocation.RightLeg:
				return FullBodyIK.Side.Right;
			case FullBodyIK.LimbIKLocation.LeftArm:
				return FullBodyIK.Side.Left;
			case FullBodyIK.LimbIKLocation.RightArm:
				return FullBodyIK.Side.Right;
			default:
				return FullBodyIK.Side.Max;
			}
		}

		// Token: 0x06000777 RID: 1911 RVA: 0x00041DC4 File Offset: 0x0003FFC4
		public static FullBodyIK.BoneType ToBoneType(FullBodyIK.BoneLocation boneLocation)
		{
			switch (boneLocation)
			{
			case FullBodyIK.BoneLocation.Neck:
				return FullBodyIK.BoneType.Neck;
			case FullBodyIK.BoneLocation.Head:
				return FullBodyIK.BoneType.Head;
			case FullBodyIK.BoneLocation.LeftEye:
				return FullBodyIK.BoneType.Eye;
			case FullBodyIK.BoneLocation.RightEye:
				return FullBodyIK.BoneType.Eye;
			case FullBodyIK.BoneLocation.LeftLeg:
				return FullBodyIK.BoneType.Leg;
			case FullBodyIK.BoneLocation.RightLeg:
				return FullBodyIK.BoneType.Leg;
			case FullBodyIK.BoneLocation.LeftKnee:
				return FullBodyIK.BoneType.Knee;
			case FullBodyIK.BoneLocation.RightKnee:
				return FullBodyIK.BoneType.Knee;
			case FullBodyIK.BoneLocation.LeftFoot:
				return FullBodyIK.BoneType.Foot;
			case FullBodyIK.BoneLocation.RightFoot:
				return FullBodyIK.BoneType.Foot;
			case FullBodyIK.BoneLocation.LeftShoulder:
				return FullBodyIK.BoneType.Shoulder;
			case FullBodyIK.BoneLocation.RightShoulder:
				return FullBodyIK.BoneType.Shoulder;
			case FullBodyIK.BoneLocation.LeftArm:
				return FullBodyIK.BoneType.Arm;
			case FullBodyIK.BoneLocation.RightArm:
				return FullBodyIK.BoneType.Arm;
			default:
				if (boneLocation == FullBodyIK.BoneLocation.Hips)
				{
					return FullBodyIK.BoneType.Hips;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.Spine && boneLocation <= FullBodyIK.BoneLocation.Spine4)
				{
					return FullBodyIK.BoneType.Spine;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.LeftArmRoll0 && boneLocation <= FullBodyIK.BoneLocation.RightArmRoll3)
				{
					return FullBodyIK.BoneType.ArmRoll;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.LeftElbowRoll0 && boneLocation <= FullBodyIK.BoneLocation.RightElbowRoll3)
				{
					return FullBodyIK.BoneType.ElbowRoll;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.LeftHandThumb0 && boneLocation <= FullBodyIK.BoneLocation.RightHandLittleTip)
				{
					return FullBodyIK.BoneType.HandFinger;
				}
				return FullBodyIK.BoneType.Max;
			case FullBodyIK.BoneLocation.LeftElbow:
				return FullBodyIK.BoneType.Elbow;
			case FullBodyIK.BoneLocation.RightElbow:
				return FullBodyIK.BoneType.Elbow;
			case FullBodyIK.BoneLocation.LeftWrist:
				return FullBodyIK.BoneType.Wrist;
			case FullBodyIK.BoneLocation.RightWrist:
				return FullBodyIK.BoneType.Wrist;
			}
		}

		// Token: 0x06000778 RID: 1912 RVA: 0x00041EE4 File Offset: 0x000400E4
		public static FullBodyIK.Side ToBoneSide(FullBodyIK.BoneLocation boneLocation)
		{
			switch (boneLocation)
			{
			case FullBodyIK.BoneLocation.LeftEye:
				return FullBodyIK.Side.Left;
			case FullBodyIK.BoneLocation.RightEye:
				return FullBodyIK.Side.Right;
			case FullBodyIK.BoneLocation.LeftLeg:
				return FullBodyIK.Side.Left;
			case FullBodyIK.BoneLocation.RightLeg:
				return FullBodyIK.Side.Right;
			case FullBodyIK.BoneLocation.LeftKnee:
				return FullBodyIK.Side.Left;
			case FullBodyIK.BoneLocation.RightKnee:
				return FullBodyIK.Side.Right;
			case FullBodyIK.BoneLocation.LeftFoot:
				return FullBodyIK.Side.Left;
			case FullBodyIK.BoneLocation.RightFoot:
				return FullBodyIK.Side.Right;
			case FullBodyIK.BoneLocation.LeftShoulder:
				return FullBodyIK.Side.Left;
			case FullBodyIK.BoneLocation.RightShoulder:
				return FullBodyIK.Side.Right;
			case FullBodyIK.BoneLocation.LeftArm:
				return FullBodyIK.Side.Left;
			case FullBodyIK.BoneLocation.RightArm:
				return FullBodyIK.Side.Right;
			default:
				if (boneLocation == FullBodyIK.BoneLocation.LeftWrist)
				{
					return FullBodyIK.Side.Left;
				}
				if (boneLocation == FullBodyIK.BoneLocation.RightWrist)
				{
					return FullBodyIK.Side.Right;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.LeftHandThumb0 && boneLocation <= FullBodyIK.BoneLocation.LeftHandLittleTip)
				{
					return FullBodyIK.Side.Left;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.LeftArmRoll0 && boneLocation <= FullBodyIK.BoneLocation.LeftArmRoll3)
				{
					return FullBodyIK.Side.Left;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.RightArmRoll0 && boneLocation <= FullBodyIK.BoneLocation.RightArmRoll3)
				{
					return FullBodyIK.Side.Right;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.LeftElbowRoll0 && boneLocation <= FullBodyIK.BoneLocation.LeftElbowRoll3)
				{
					return FullBodyIK.Side.Left;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.RightElbowRoll0 && boneLocation <= FullBodyIK.BoneLocation.RightElbowRoll3)
				{
					return FullBodyIK.Side.Right;
				}
				if (boneLocation >= FullBodyIK.BoneLocation.RightHandThumb0 && boneLocation <= FullBodyIK.BoneLocation.RightHandLittleTip)
				{
					return FullBodyIK.Side.Right;
				}
				return FullBodyIK.Side.Max;
			case FullBodyIK.BoneLocation.LeftElbow:
				return FullBodyIK.Side.Left;
			case FullBodyIK.BoneLocation.RightElbow:
				return FullBodyIK.Side.Right;
			}
		}

		// Token: 0x06000779 RID: 1913 RVA: 0x00041FF3 File Offset: 0x000401F3
		public static FullBodyIK.FingerType ToFingerType(FullBodyIK.BoneLocation boneLocation)
		{
			if (boneLocation >= FullBodyIK.BoneLocation.LeftHandThumb0 && boneLocation <= FullBodyIK.BoneLocation.LeftHandLittleTip)
			{
				return (FullBodyIK.FingerType)((boneLocation - 39) / FullBodyIK.BoneLocation.Spine4);
			}
			if (boneLocation >= FullBodyIK.BoneLocation.RightHandThumb0 && boneLocation <= FullBodyIK.BoneLocation.RightHandLittleTip)
			{
				return (FullBodyIK.FingerType)((boneLocation - 59) / FullBodyIK.BoneLocation.Spine4);
			}
			return FullBodyIK.FingerType.Max;
		}

		// Token: 0x0600077A RID: 1914 RVA: 0x00042024 File Offset: 0x00040224
		public static int ToFingerIndex(FullBodyIK.BoneLocation boneLocation)
		{
			if (boneLocation >= FullBodyIK.BoneLocation.LeftHandThumb0 && boneLocation <= FullBodyIK.BoneLocation.LeftHandLittleTip)
			{
				return (boneLocation - FullBodyIK.BoneLocation.LeftHandThumb0) % 4;
			}
			if (boneLocation >= FullBodyIK.BoneLocation.RightHandThumb0 && boneLocation <= FullBodyIK.BoneLocation.RightHandLittleTip)
			{
				return (boneLocation - FullBodyIK.BoneLocation.RightHandThumb0) % 4;
			}
			return -1;
		}

		// Token: 0x0600077B RID: 1915 RVA: 0x00042058 File Offset: 0x00040258
		public static FullBodyIK.EffectorType ToEffectorType(FullBodyIK.EffectorLocation effectorLocation)
		{
			switch (effectorLocation)
			{
			case FullBodyIK.EffectorLocation.Root:
				return FullBodyIK.EffectorType.Root;
			case FullBodyIK.EffectorLocation.Hips:
				return FullBodyIK.EffectorType.Hips;
			case FullBodyIK.EffectorLocation.Neck:
				return FullBodyIK.EffectorType.Neck;
			case FullBodyIK.EffectorLocation.Head:
				return FullBodyIK.EffectorType.Head;
			case FullBodyIK.EffectorLocation.Eyes:
				return FullBodyIK.EffectorType.Eyes;
			case FullBodyIK.EffectorLocation.LeftKnee:
				return FullBodyIK.EffectorType.Knee;
			case FullBodyIK.EffectorLocation.RightKnee:
				return FullBodyIK.EffectorType.Knee;
			case FullBodyIK.EffectorLocation.LeftFoot:
				return FullBodyIK.EffectorType.Foot;
			case FullBodyIK.EffectorLocation.RightFoot:
				return FullBodyIK.EffectorType.Foot;
			case FullBodyIK.EffectorLocation.LeftArm:
				return FullBodyIK.EffectorType.Arm;
			case FullBodyIK.EffectorLocation.RightArm:
				return FullBodyIK.EffectorType.Arm;
			case FullBodyIK.EffectorLocation.LeftElbow:
				return FullBodyIK.EffectorType.Elbow;
			case FullBodyIK.EffectorLocation.RightElbow:
				return FullBodyIK.EffectorType.Elbow;
			case FullBodyIK.EffectorLocation.LeftWrist:
				return FullBodyIK.EffectorType.Wrist;
			case FullBodyIK.EffectorLocation.RightWrist:
				return FullBodyIK.EffectorType.Wrist;
			default:
				if (effectorLocation >= FullBodyIK.EffectorLocation.LeftHandThumb && effectorLocation <= FullBodyIK.EffectorLocation.RightHandLittle)
				{
					return FullBodyIK.EffectorType.HandFinger;
				}
				return FullBodyIK.EffectorType.Max;
			}
		}

		// Token: 0x0600077C RID: 1916 RVA: 0x000420E4 File Offset: 0x000402E4
		public static FullBodyIK.Side ToEffectorSide(FullBodyIK.EffectorLocation effectorLocation)
		{
			switch (effectorLocation)
			{
			case FullBodyIK.EffectorLocation.LeftKnee:
				return FullBodyIK.Side.Left;
			case FullBodyIK.EffectorLocation.RightKnee:
				return FullBodyIK.Side.Right;
			case FullBodyIK.EffectorLocation.LeftFoot:
				return FullBodyIK.Side.Left;
			case FullBodyIK.EffectorLocation.RightFoot:
				return FullBodyIK.Side.Right;
			case FullBodyIK.EffectorLocation.LeftArm:
				return FullBodyIK.Side.Left;
			case FullBodyIK.EffectorLocation.RightArm:
				return FullBodyIK.Side.Right;
			case FullBodyIK.EffectorLocation.LeftElbow:
				return FullBodyIK.Side.Left;
			case FullBodyIK.EffectorLocation.RightElbow:
				return FullBodyIK.Side.Right;
			case FullBodyIK.EffectorLocation.LeftWrist:
				return FullBodyIK.Side.Left;
			case FullBodyIK.EffectorLocation.RightWrist:
				return FullBodyIK.Side.Right;
			default:
				if (effectorLocation >= FullBodyIK.EffectorLocation.LeftHandThumb && effectorLocation <= FullBodyIK.EffectorLocation.LeftHandLittle)
				{
					return FullBodyIK.Side.Left;
				}
				if (effectorLocation >= FullBodyIK.EffectorLocation.RightHandThumb && effectorLocation <= FullBodyIK.EffectorLocation.RightHandLittle)
				{
					return FullBodyIK.Side.Right;
				}
				return FullBodyIK.Side.Max;
			}
		}

		// Token: 0x0600077D RID: 1917 RVA: 0x00042160 File Offset: 0x00040360
		public static string GetEffectorName(FullBodyIK.EffectorLocation effectorLocation)
		{
			if (effectorLocation == FullBodyIK.EffectorLocation.Root)
			{
				return "FullBodyIK";
			}
			if (FullBodyIK.IsHandFingerEffectors(effectorLocation))
			{
				return FullBodyIK.ToFingerType(effectorLocation).ToString();
			}
			return effectorLocation.ToString();
		}

		// Token: 0x0600077E RID: 1918 RVA: 0x000421A8 File Offset: 0x000403A8
		public static bool IsHandFingerEffectors(FullBodyIK.EffectorLocation effectorLocation)
		{
			return effectorLocation >= FullBodyIK.EffectorLocation.LeftHandThumb && effectorLocation <= FullBodyIK.EffectorLocation.RightHandLittle;
		}

		// Token: 0x0600077F RID: 1919 RVA: 0x000421CC File Offset: 0x000403CC
		public static FullBodyIK.FingerType ToFingerType(FullBodyIK.EffectorLocation effectorLocation)
		{
			if (FullBodyIK.IsHandFingerEffectors(effectorLocation))
			{
				int num = effectorLocation - FullBodyIK.EffectorLocation.LeftHandThumb;
				return (FullBodyIK.FingerType)(num % 5);
			}
			return FullBodyIK.FingerType.Max;
		}

		// Token: 0x06000780 RID: 1920 RVA: 0x000421EE File Offset: 0x000403EE
		public static void SafeNew<TYPE_>(ref TYPE_ obj) where TYPE_ : class, new()
		{
			if (obj == null)
			{
				obj = Activator.CreateInstance<TYPE_>();
			}
		}

		// Token: 0x06000781 RID: 1921 RVA: 0x0004220B File Offset: 0x0004040B
		public static void SafeResize<TYPE_>(ref TYPE_[] objArray, int length)
		{
			if (objArray == null)
			{
				objArray = new TYPE_[length];
			}
			else
			{
				Array.Resize<TYPE_>(ref objArray, length);
			}
		}

		// Token: 0x06000782 RID: 1922 RVA: 0x00042228 File Offset: 0x00040428
		public static void PrepareArray<TypeA, TypeB>(ref TypeA[] dstArray, TypeB[] srcArray)
		{
			if (srcArray != null)
			{
				if (dstArray == null || dstArray.Length != srcArray.Length)
				{
					dstArray = new TypeA[srcArray.Length];
				}
			}
			else
			{
				dstArray = null;
			}
		}

		// Token: 0x06000783 RID: 1923 RVA: 0x00042258 File Offset: 0x00040458
		public static void CloneArray<Type>(ref Type[] dstArray, Type[] srcArray)
		{
			if (srcArray != null)
			{
				if (dstArray == null || dstArray.Length != srcArray.Length)
				{
					dstArray = new Type[srcArray.Length];
				}
				for (int i = 0; i < srcArray.Length; i++)
				{
					dstArray[i] = srcArray[i];
				}
			}
			else
			{
				dstArray = null;
			}
		}

		// Token: 0x06000784 RID: 1924 RVA: 0x000422B3 File Offset: 0x000404B3
		public static void DestroyImmediate(ref Transform transform)
		{
			if (transform != null)
			{
				UnityEngine.Object.DestroyImmediate(transform.gameObject);
				transform = null;
			}
			else
			{
				transform = null;
			}
		}

		// Token: 0x06000785 RID: 1925 RVA: 0x000422D9 File Offset: 0x000404D9
		public static void DestroyImmediate(ref Transform transform, bool allowDestroyingAssets)
		{
			if (transform != null)
			{
				UnityEngine.Object.DestroyImmediate(transform.gameObject, allowDestroyingAssets);
				transform = null;
			}
			else
			{
				transform = null;
			}
		}

		// Token: 0x06000786 RID: 1926 RVA: 0x00042300 File Offset: 0x00040500
		public static bool CheckAlive<Type>(ref Type obj) where Type : UnityEngine.Object
		{
			if (obj != null)
			{
				return true;
			}
			obj = (Type)((object)null);
			return false;
		}

		// Token: 0x06000787 RID: 1927 RVA: 0x00042327 File Offset: 0x00040527
		public static bool IsParentOfRecusively(Transform parent, Transform child)
		{
			while (child != null)
			{
				if (child.parent == parent)
				{
					return true;
				}
				child = child.parent;
			}
			return false;
		}

		// Token: 0x06000788 RID: 1928 RVA: 0x00042356 File Offset: 0x00040556
		private static FullBodyIK.Bone _PrepareBone(FullBodyIK.Bone bone)
		{
			return (bone == null || !bone.transformIsAlive) ? null : bone;
		}

		// Token: 0x06000789 RID: 1929 RVA: 0x00042370 File Offset: 0x00040570
		private static FullBodyIK.Bone[] _PrepareBones(FullBodyIK.Bone leftBone, FullBodyIK.Bone rightBone)
		{
			if (leftBone != null && rightBone != null && leftBone.transformIsAlive && rightBone.transformIsAlive)
			{
				return new FullBodyIK.Bone[]
				{
					leftBone,
					rightBone
				};
			}
			return null;
		}

		// Token: 0x0600078A RID: 1930 RVA: 0x000423B4 File Offset: 0x000405B4
		private static bool _ComputeEyesRange(ref Vector3 eyesDir, float rangeTheta)
		{
			if (rangeTheta >= -1E-07f)
			{
				if (eyesDir.z < 0f)
				{
					eyesDir.z = -eyesDir.z;
				}
				return true;
			}
			if (rangeTheta < -0.9999999f)
			{
				return true;
			}
			float num = -rangeTheta;
			eyesDir.z += num;
			if (eyesDir.z < 0f)
			{
				eyesDir.z *= 1f / (1f - num);
			}
			else
			{
				eyesDir.z *= 1f / (1f + num);
			}
			float num2 = FullBodyIK.SAFBIKSqrt(eyesDir.x * eyesDir.x + eyesDir.y * eyesDir.y);
			if (num2 > 1E-45f)
			{
				float num3 = FullBodyIK.SAFBIKSqrt(1f - eyesDir.z * eyesDir.z);
				float num4 = num3 / num2;
				eyesDir.x *= num4;
				eyesDir.y *= num4;
				return true;
			}
			eyesDir.x = 0f;
			eyesDir.y = 0f;
			eyesDir.z = 1f;
			return false;
		}

		// Token: 0x0600078B RID: 1931 RVA: 0x000424DC File Offset: 0x000406DC
		public static string _GetAvatarName(Transform rootTransform)
		{
			if (rootTransform != null)
			{
				Animator component = rootTransform.GetComponent<Animator>();
				if (component != null)
				{
					Avatar avatar = component.avatar;
					if (avatar != null)
					{
						return avatar.name;
					}
				}
			}
			return null;
		}

		// Token: 0x0600078C RID: 1932 RVA: 0x000195B1 File Offset: 0x000177B1
		[Conditional("SAFULLBODYIK_DEBUG")]
		public static void DebugLog(object msg)
		{
			UnityEngine.Debug.Log(msg);
		}

		// Token: 0x0600078D RID: 1933 RVA: 0x000195B9 File Offset: 0x000177B9
		[Conditional("SAFULLBODYIK_DEBUG")]
		public static void DebugLogWarning(object msg)
		{
			UnityEngine.Debug.LogWarning(msg);
		}

		// Token: 0x0600078E RID: 1934 RVA: 0x000195C1 File Offset: 0x000177C1
		[Conditional("SAFULLBODYIK_DEBUG")]
		public static void DebugLogError(object msg)
		{
			UnityEngine.Debug.LogError(msg);
		}

		// Token: 0x0600078F RID: 1935 RVA: 0x00042523 File Offset: 0x00040723
		[Conditional("SAFULLBODYIK_DEBUG")]
		public static void Assert(bool cmp)
		{
			if (!cmp)
			{
				UnityEngine.Debug.LogError("Assert");
				UnityEngine.Debug.Break();
			}
		}

		// Token: 0x06000790 RID: 1936 RVA: 0x0004253C File Offset: 0x0004073C
		[Conditional("SAFULLBODYIK_DEBUG_CHECKEVAL")]
		public static void CheckNormalized(Vector3 v)
		{
			float num = 0.0001f;
			float num2 = v.x * v.x + v.y * v.y + v.z * v.z;
			if (num2 < 1f - num || num2 > 1f + num)
			{
				UnityEngine.Debug.LogError("CheckNormalized:" + num2.ToString("F6"));
				UnityEngine.Debug.Break();
			}
		}

		// Token: 0x06000791 RID: 1937 RVA: 0x000425B9 File Offset: 0x000407B9
		[Conditional("SAFULLBODYIK_DEBUG_CHECKEVAL")]
		public static void CheckNaN(float f)
		{
			if (float.IsNaN(f))
			{
				UnityEngine.Debug.LogError("NaN");
			}
		}

		// Token: 0x06000792 RID: 1938 RVA: 0x000425D0 File Offset: 0x000407D0
		[Conditional("SAFULLBODYIK_DEBUG_CHECKEVAL")]
		public static void CheckNaN(Vector3 v)
		{
			if (float.IsNaN(v.x) || float.IsNaN(v.y) || float.IsNaN(v.z))
			{
				UnityEngine.Debug.LogError("NaN:" + v);
			}
		}

		// Token: 0x06000793 RID: 1939 RVA: 0x00042628 File Offset: 0x00040828
		[Conditional("SAFULLBODYIK_DEBUG_CHECKEVAL")]
		public static void CheckNaN(Quaternion q)
		{
			if (float.IsNaN(q.x) || float.IsNaN(q.y) || float.IsNaN(q.z) || float.IsNaN(q.w))
			{
				UnityEngine.Debug.LogError("NaN:" + q);
			}
		}

		// Token: 0x04000B4A RID: 2890
		public Transform rootTransform;

		// Token: 0x04000B4B RID: 2891
		[NonSerialized]
		public FullBodyIK.InternalValues internalValues = new FullBodyIK.InternalValues();

		// Token: 0x04000B4C RID: 2892
		[NonSerialized]
		public FullBodyIK.BoneCaches boneCaches = new FullBodyIK.BoneCaches();

		// Token: 0x04000B4D RID: 2893
		public FullBodyIK.Settings settings;

		// Token: 0x04000B4E RID: 2894
		public FullBodyIK.EditorSettings editorSettings;

		// Token: 0x04000B4F RID: 2895
		public FullBodyIK.BodyBones bodyBones;

		// Token: 0x04000B50 RID: 2896
		public FullBodyIK.HeadBones headBones;

		// Token: 0x04000B51 RID: 2897
		public FullBodyIK.LegBones leftLegBones;

		// Token: 0x04000B52 RID: 2898
		public FullBodyIK.LegBones rightLegBones;

		// Token: 0x04000B53 RID: 2899
		public FullBodyIK.ArmBones leftArmBones;

		// Token: 0x04000B54 RID: 2900
		public FullBodyIK.ArmBones rightArmBones;

		// Token: 0x04000B55 RID: 2901
		public FullBodyIK.FingersBones leftHandFingersBones;

		// Token: 0x04000B56 RID: 2902
		public FullBodyIK.FingersBones rightHandFingersBones;

		// Token: 0x04000B57 RID: 2903
		public FullBodyIK.Effector rootEffector;

		// Token: 0x04000B58 RID: 2904
		public FullBodyIK.BodyEffectors bodyEffectors;

		// Token: 0x04000B59 RID: 2905
		public FullBodyIK.HeadEffectors headEffectors;

		// Token: 0x04000B5A RID: 2906
		public FullBodyIK.LegEffectors leftLegEffectors;

		// Token: 0x04000B5B RID: 2907
		public FullBodyIK.LegEffectors rightLegEffectors;

		// Token: 0x04000B5C RID: 2908
		public FullBodyIK.ArmEffectors leftArmEffectors;

		// Token: 0x04000B5D RID: 2909
		public FullBodyIK.ArmEffectors rightArmEffectors;

		// Token: 0x04000B5E RID: 2910
		public FullBodyIK.FingersEffectors leftHandFingersEffectors;

		// Token: 0x04000B5F RID: 2911
		public FullBodyIK.FingersEffectors rightHandFingersEffectors;

		// Token: 0x04000B60 RID: 2912
		private FullBodyIK.Bone[] _bones = new FullBodyIK.Bone[15];

		// Token: 0x04000B61 RID: 2913
		private FullBodyIK.Effector[] _effectors = new FullBodyIK.Effector[25];

		// Token: 0x04000B62 RID: 2914
		private FullBodyIK.BodyIK _bodyIK;

		// Token: 0x04000B63 RID: 2915
		private FullBodyIK.LimbIK[] _limbIK = new FullBodyIK.LimbIK[4];

		// Token: 0x04000B64 RID: 2916
		private FullBodyIK.HeadIK _headIK;

		// Token: 0x04000B65 RID: 2917
		private FullBodyIK.FingerIK[] _fingerIK = new FullBodyIK.FingerIK[2];

		// Token: 0x04000B66 RID: 2918
		private bool _isNeedFixShoulderWorldTransform;

		// Token: 0x04000B67 RID: 2919
		private bool _isPrefixed;

		// Token: 0x04000B68 RID: 2920
		private bool _isPrepared;

		// Token: 0x04000B69 RID: 2921
		[SerializeField]
		private bool _isPrefixedAtLeastOnce;

		// Token: 0x04000B6A RID: 2922
		private static readonly string[] _LeftKeywords = new string[]
		{
			"left",
			"_l"
		};

		// Token: 0x04000B6B RID: 2923
		private static readonly string[] _RightKeywords = new string[]
		{
			"right",
			"_r"
		};

		// Token: 0x04000B6C RID: 2924
		private bool _isAnimatorCheckedAtLeastOnce;

		// Token: 0x04000B6D RID: 2925
		private bool _isSyncDisplacementAtLeastOnce;

		// Token: 0x04000B6E RID: 2926
		public const float FLOAT_EPSILON = 1E-45f;

		// Token: 0x04000B6F RID: 2927
		public const float IKEpsilon = 1E-07f;

		// Token: 0x04000B70 RID: 2928
		public const float IKMoveEpsilon = 1E-05f;

		// Token: 0x04000B71 RID: 2929
		public const float IKWritebackEpsilon = 0.01f;

		// Token: 0x04000B72 RID: 2930
		public const int MaxArmRollLength = 4;

		// Token: 0x04000B73 RID: 2931
		public const int MaxElbowRollLength = 4;

		// Token: 0x04000B74 RID: 2932
		public const int MaxHandFingerLength = 4;

		// Token: 0x04000B75 RID: 2933
		public const float Eyes_DefaultDistance = 1f;

		// Token: 0x04000B76 RID: 2934
		public const float Eyes_MinDistance = 0.5f;

		// Token: 0x04000B77 RID: 2935
		public const float SimualteEys_NeckHeadDistanceScale = 1f;

		// Token: 0x02000175 RID: 373
		[Serializable]
		public class BodyBones
		{
			// Token: 0x1700010D RID: 269
			// (get) Token: 0x06000796 RID: 1942 RVA: 0x000426C6 File Offset: 0x000408C6
			public FullBodyIK.Bone spineU
			{
				get
				{
					return this.spine4;
				}
			}

			// Token: 0x04000B78 RID: 2936
			public FullBodyIK.Bone hips;

			// Token: 0x04000B79 RID: 2937
			public FullBodyIK.Bone spine;

			// Token: 0x04000B7A RID: 2938
			public FullBodyIK.Bone spine2;

			// Token: 0x04000B7B RID: 2939
			public FullBodyIK.Bone spine3;

			// Token: 0x04000B7C RID: 2940
			public FullBodyIK.Bone spine4;
		}

		// Token: 0x02000176 RID: 374
		[Serializable]
		public class HeadBones
		{
			// Token: 0x04000B7D RID: 2941
			public FullBodyIK.Bone neck;

			// Token: 0x04000B7E RID: 2942
			public FullBodyIK.Bone head;

			// Token: 0x04000B7F RID: 2943
			public FullBodyIK.Bone leftEye;

			// Token: 0x04000B80 RID: 2944
			public FullBodyIK.Bone rightEye;
		}

		// Token: 0x02000177 RID: 375
		[Serializable]
		public class LegBones
		{
			// Token: 0x04000B81 RID: 2945
			public FullBodyIK.Bone leg;

			// Token: 0x04000B82 RID: 2946
			public FullBodyIK.Bone knee;

			// Token: 0x04000B83 RID: 2947
			public FullBodyIK.Bone foot;
		}

		// Token: 0x02000178 RID: 376
		[Serializable]
		public class ArmBones
		{
			// Token: 0x0600079A RID: 1946 RVA: 0x000426CE File Offset: 0x000408CE
			public void Repair()
			{
				FullBodyIK.SafeResize<FullBodyIK.Bone>(ref this.armRoll, 4);
				FullBodyIK.SafeResize<FullBodyIK.Bone>(ref this.elbowRoll, 4);
			}

			// Token: 0x04000B84 RID: 2948
			public FullBodyIK.Bone shoulder;

			// Token: 0x04000B85 RID: 2949
			public FullBodyIK.Bone arm;

			// Token: 0x04000B86 RID: 2950
			public FullBodyIK.Bone[] armRoll;

			// Token: 0x04000B87 RID: 2951
			public FullBodyIK.Bone elbow;

			// Token: 0x04000B88 RID: 2952
			public FullBodyIK.Bone[] elbowRoll;

			// Token: 0x04000B89 RID: 2953
			public FullBodyIK.Bone wrist;
		}

		// Token: 0x02000179 RID: 377
		[Serializable]
		public class FingersBones
		{
			// Token: 0x0600079C RID: 1948 RVA: 0x000426E8 File Offset: 0x000408E8
			public void Repair()
			{
				FullBodyIK.SafeResize<FullBodyIK.Bone>(ref this.thumb, 4);
				FullBodyIK.SafeResize<FullBodyIK.Bone>(ref this.index, 4);
				FullBodyIK.SafeResize<FullBodyIK.Bone>(ref this.middle, 4);
				FullBodyIK.SafeResize<FullBodyIK.Bone>(ref this.ring, 4);
				FullBodyIK.SafeResize<FullBodyIK.Bone>(ref this.little, 4);
			}

			// Token: 0x04000B8A RID: 2954
			public FullBodyIK.Bone[] thumb;

			// Token: 0x04000B8B RID: 2955
			public FullBodyIK.Bone[] index;

			// Token: 0x04000B8C RID: 2956
			public FullBodyIK.Bone[] middle;

			// Token: 0x04000B8D RID: 2957
			public FullBodyIK.Bone[] ring;

			// Token: 0x04000B8E RID: 2958
			public FullBodyIK.Bone[] little;
		}

		// Token: 0x0200017A RID: 378
		[Serializable]
		public class BodyEffectors
		{
			// Token: 0x04000B8F RID: 2959
			public FullBodyIK.Effector hips;
		}

		// Token: 0x0200017B RID: 379
		[Serializable]
		public class HeadEffectors
		{
			// Token: 0x04000B90 RID: 2960
			public FullBodyIK.Effector neck;

			// Token: 0x04000B91 RID: 2961
			public FullBodyIK.Effector head;

			// Token: 0x04000B92 RID: 2962
			public FullBodyIK.Effector eyes;
		}

		// Token: 0x0200017C RID: 380
		[Serializable]
		public class LegEffectors
		{
			// Token: 0x04000B93 RID: 2963
			public FullBodyIK.Effector knee;

			// Token: 0x04000B94 RID: 2964
			public FullBodyIK.Effector foot;
		}

		// Token: 0x0200017D RID: 381
		[Serializable]
		public class ArmEffectors
		{
			// Token: 0x04000B95 RID: 2965
			public FullBodyIK.Effector arm;

			// Token: 0x04000B96 RID: 2966
			public FullBodyIK.Effector elbow;

			// Token: 0x04000B97 RID: 2967
			public FullBodyIK.Effector wrist;
		}

		// Token: 0x0200017E RID: 382
		[Serializable]
		public class FingersEffectors
		{
			// Token: 0x04000B98 RID: 2968
			public FullBodyIK.Effector thumb;

			// Token: 0x04000B99 RID: 2969
			public FullBodyIK.Effector index;

			// Token: 0x04000B9A RID: 2970
			public FullBodyIK.Effector middle;

			// Token: 0x04000B9B RID: 2971
			public FullBodyIK.Effector ring;

			// Token: 0x04000B9C RID: 2972
			public FullBodyIK.Effector little;
		}

		// Token: 0x0200017F RID: 383
		public enum AutomaticBool
		{
			// Token: 0x04000B9E RID: 2974
			Auto = -1,
			// Token: 0x04000B9F RID: 2975
			Disable,
			// Token: 0x04000BA0 RID: 2976
			Enable
		}

		// Token: 0x02000180 RID: 384
		public enum SyncDisplacement
		{
			// Token: 0x04000BA2 RID: 2978
			Disable,
			// Token: 0x04000BA3 RID: 2979
			Firstframe,
			// Token: 0x04000BA4 RID: 2980
			Everyframe
		}

		// Token: 0x02000181 RID: 385
		[Serializable]
		public class Settings
		{
			// Token: 0x060007A3 RID: 1955 RVA: 0x00042751 File Offset: 0x00040951
			public void Prefix()
			{
				FullBodyIK.SafeNew<FullBodyIK.Settings.BodyIK>(ref this.bodyIK);
				FullBodyIK.SafeNew<FullBodyIK.Settings.LimbIK>(ref this.limbIK);
				FullBodyIK.SafeNew<FullBodyIK.Settings.HeadIK>(ref this.headIK);
				FullBodyIK.SafeNew<FullBodyIK.Settings.FingerIK>(ref this.fingerIK);
			}

			// Token: 0x04000BA5 RID: 2981
			public FullBodyIK.AutomaticBool animatorEnabled = FullBodyIK.AutomaticBool.Auto;

			// Token: 0x04000BA6 RID: 2982
			public FullBodyIK.AutomaticBool resetTransforms = FullBodyIK.AutomaticBool.Auto;

			// Token: 0x04000BA7 RID: 2983
			public FullBodyIK.SyncDisplacement syncDisplacement;

			// Token: 0x04000BA8 RID: 2984
			public FullBodyIK.AutomaticBool shoulderDirYAsNeck = FullBodyIK.AutomaticBool.Auto;

			// Token: 0x04000BA9 RID: 2985
			public bool automaticPrepareHumanoid = true;

			// Token: 0x04000BAA RID: 2986
			public bool automaticConfigureSpineEnabled;

			// Token: 0x04000BAB RID: 2987
			public bool automaticConfigureRollBonesEnabled;

			// Token: 0x04000BAC RID: 2988
			public bool rollBonesEnabled;

			// Token: 0x04000BAD RID: 2989
			public bool createEffectorTransform = true;

			// Token: 0x04000BAE RID: 2990
			public FullBodyIK.Settings.BodyIK bodyIK;

			// Token: 0x04000BAF RID: 2991
			public FullBodyIK.Settings.LimbIK limbIK;

			// Token: 0x04000BB0 RID: 2992
			public FullBodyIK.Settings.HeadIK headIK;

			// Token: 0x04000BB1 RID: 2993
			public FullBodyIK.Settings.FingerIK fingerIK;

			// Token: 0x02000182 RID: 386
			[Serializable]
			public class BodyIK
			{
				// Token: 0x04000BB2 RID: 2994
				public bool forceSolveEnabled = true;

				// Token: 0x04000BB3 RID: 2995
				public bool lowerSolveEnabled = true;

				// Token: 0x04000BB4 RID: 2996
				public bool upperSolveEnabled = true;

				// Token: 0x04000BB5 RID: 2997
				public bool computeWorldTransform = true;

				// Token: 0x04000BB6 RID: 2998
				public bool shoulderSolveEnabled = true;

				// Token: 0x04000BB7 RID: 2999
				public float shoulderSolveBendingRate = 0.25f;

				// Token: 0x04000BB8 RID: 3000
				public bool shoulderLimitEnabled = true;

				// Token: 0x04000BB9 RID: 3001
				public float shoulderLimitAngleYPlus = 30f;

				// Token: 0x04000BBA RID: 3002
				public float shoulderLimitAngleYMinus = 1f;

				// Token: 0x04000BBB RID: 3003
				public float shoulderLimitAngleZ = 30f;

				// Token: 0x04000BBC RID: 3004
				public float spineDirXLegToArmRate = 0.5f;

				// Token: 0x04000BBD RID: 3005
				public float spineDirXLegToArmToRate = 1f;

				// Token: 0x04000BBE RID: 3006
				public float spineDirYLerpRate = 0.5f;

				// Token: 0x04000BBF RID: 3007
				public float upperBodyMovingfixRate = 1f;

				// Token: 0x04000BC0 RID: 3008
				public float upperHeadMovingfixRate = 0.8f;

				// Token: 0x04000BC1 RID: 3009
				public float upperCenterLegTranslateRate = 0.5f;

				// Token: 0x04000BC2 RID: 3010
				public float upperSpineTranslateRate = 0.65f;

				// Token: 0x04000BC3 RID: 3011
				public float upperCenterLegRotateRate = 0.6f;

				// Token: 0x04000BC4 RID: 3012
				public float upperSpineRotateRate = 0.9f;

				// Token: 0x04000BC5 RID: 3013
				public float upperPostTranslateRate = 1f;

				// Token: 0x04000BC6 RID: 3014
				public bool upperSolveHipsEnabled = true;

				// Token: 0x04000BC7 RID: 3015
				public bool upperSolveSpineEnabled = true;

				// Token: 0x04000BC8 RID: 3016
				public bool upperSolveSpine2Enabled = true;

				// Token: 0x04000BC9 RID: 3017
				public bool upperSolveSpine3Enabled = true;

				// Token: 0x04000BCA RID: 3018
				public bool upperSolveSpine4Enabled = true;

				// Token: 0x04000BCB RID: 3019
				public float upperCenterLegLerpRate = 1f;

				// Token: 0x04000BCC RID: 3020
				public float upperSpineLerpRate = 1f;

				// Token: 0x04000BCD RID: 3021
				public bool upperDirXLimitEnabled = true;

				// Token: 0x04000BCE RID: 3022
				public float upperDirXLimitAngleY = 20f;

				// Token: 0x04000BCF RID: 3023
				public bool spineLimitEnabled = true;

				// Token: 0x04000BD0 RID: 3024
				public bool spineAccurateLimitEnabled;

				// Token: 0x04000BD1 RID: 3025
				public float spineLimitAngleX = 40f;

				// Token: 0x04000BD2 RID: 3026
				public float spineLimitAngleY = 25f;

				// Token: 0x04000BD3 RID: 3027
				public float upperContinuousPreTranslateRate = 0.2f;

				// Token: 0x04000BD4 RID: 3028
				public float upperContinuousPreTranslateStableRate = 0.65f;

				// Token: 0x04000BD5 RID: 3029
				public float upperContinuousCenterLegRotationStableRate;

				// Token: 0x04000BD6 RID: 3030
				public float upperContinuousPostTranslateStableRate = 0.01f;

				// Token: 0x04000BD7 RID: 3031
				public float upperContinuousSpineDirYLerpRate = 0.5f;

				// Token: 0x04000BD8 RID: 3032
				public float upperNeckToCenterLegRate = 0.6f;

				// Token: 0x04000BD9 RID: 3033
				public float upperNeckToSpineRate = 0.9f;

				// Token: 0x04000BDA RID: 3034
				public float upperEyesToCenterLegRate = 0.2f;

				// Token: 0x04000BDB RID: 3035
				public float upperEyesToSpineRate = 0.5f;

				// Token: 0x04000BDC RID: 3036
				public float upperEyesYawRate = 0.8f;

				// Token: 0x04000BDD RID: 3037
				public float upperEyesPitchUpRate = 0.25f;

				// Token: 0x04000BDE RID: 3038
				public float upperEyesPitchDownRate = 0.5f;

				// Token: 0x04000BDF RID: 3039
				public float upperEyesLimitYaw = 80f;

				// Token: 0x04000BE0 RID: 3040
				public float upperEyesLimitPitchUp = 10f;

				// Token: 0x04000BE1 RID: 3041
				public float upperEyesLimitPitchDown = 45f;

				// Token: 0x04000BE2 RID: 3042
				public float upperEyesTraceAngle = 160f;
			}

			// Token: 0x02000183 RID: 387
			[Serializable]
			public class LimbIK
			{
				// Token: 0x04000BE3 RID: 3043
				public bool legAlwaysSolveEnabled = true;

				// Token: 0x04000BE4 RID: 3044
				public bool armAlwaysSolveEnabled;

				// Token: 0x04000BE5 RID: 3045
				public float automaticKneeBaseAngle;

				// Token: 0x04000BE6 RID: 3046
				public bool presolveKneeEnabled;

				// Token: 0x04000BE7 RID: 3047
				public bool presolveElbowEnabled;

				// Token: 0x04000BE8 RID: 3048
				public float presolveKneeRate = 1f;

				// Token: 0x04000BE9 RID: 3049
				public float presolveKneeLerpAngle = 10f;

				// Token: 0x04000BEA RID: 3050
				public float presolveKneeLerpLengthRate = 0.1f;

				// Token: 0x04000BEB RID: 3051
				public float presolveElbowRate = 1f;

				// Token: 0x04000BEC RID: 3052
				public float presolveElbowLerpAngle = 10f;

				// Token: 0x04000BED RID: 3053
				public float presolveElbowLerpLengthRate = 0.1f;

				// Token: 0x04000BEE RID: 3054
				public bool prefixLegEffectorEnabled = true;

				// Token: 0x04000BEF RID: 3055
				public float prefixLegUpperLimitAngle = 60f;

				// Token: 0x04000BF0 RID: 3056
				public float prefixKneeUpperLimitAngle = 45f;

				// Token: 0x04000BF1 RID: 3057
				public float legEffectorMinLengthRate = 0.1f;

				// Token: 0x04000BF2 RID: 3058
				public float legEffectorMaxLengthRate = 0.9999f;

				// Token: 0x04000BF3 RID: 3059
				public float armEffectorMaxLengthRate = 0.9999f;

				// Token: 0x04000BF4 RID: 3060
				public bool armBasisForcefixEnabled = true;

				// Token: 0x04000BF5 RID: 3061
				public float armBasisForcefixEffectorLengthRate = 0.99f;

				// Token: 0x04000BF6 RID: 3062
				public float armBasisForcefixEffectorLengthLerpRate = 0.03f;

				// Token: 0x04000BF7 RID: 3063
				public bool armEffectorBackfixEnabled = true;

				// Token: 0x04000BF8 RID: 3064
				public bool armEffectorInnerfixEnabled = true;

				// Token: 0x04000BF9 RID: 3065
				public float armEffectorBackBeginAngle = 5f;

				// Token: 0x04000BFA RID: 3066
				public float armEffectorBackCoreBeginAngle = -10f;

				// Token: 0x04000BFB RID: 3067
				public float armEffectorBackCoreEndAngle = -30f;

				// Token: 0x04000BFC RID: 3068
				public float armEffectorBackEndAngle = -160f;

				// Token: 0x04000BFD RID: 3069
				public float armEffectorBackCoreUpperAngle = 8f;

				// Token: 0x04000BFE RID: 3070
				public float armEffectorBackCoreLowerAngle = -15f;

				// Token: 0x04000BFF RID: 3071
				public float automaticElbowBaseAngle = 30f;

				// Token: 0x04000C00 RID: 3072
				public float automaticElbowLowerAngle = 90f;

				// Token: 0x04000C01 RID: 3073
				public float automaticElbowUpperAngle = 90f;

				// Token: 0x04000C02 RID: 3074
				public float automaticElbowBackUpperAngle = 180f;

				// Token: 0x04000C03 RID: 3075
				public float automaticElbowBackLowerAngle = 330f;

				// Token: 0x04000C04 RID: 3076
				public float elbowFrontInnerLimitAngle = 5f;

				// Token: 0x04000C05 RID: 3077
				public float elbowBackInnerLimitAngle;

				// Token: 0x04000C06 RID: 3078
				public bool wristLimitEnabled = true;

				// Token: 0x04000C07 RID: 3079
				public float wristLimitAngle = 90f;

				// Token: 0x04000C08 RID: 3080
				public bool footLimitEnabled = true;

				// Token: 0x04000C09 RID: 3081
				public float footLimitYaw = 45f;

				// Token: 0x04000C0A RID: 3082
				public float footLimitPitchUp = 45f;

				// Token: 0x04000C0B RID: 3083
				public float footLimitPitchDown = 60f;

				// Token: 0x04000C0C RID: 3084
				public float footLimitRoll = 45f;
			}

			// Token: 0x02000184 RID: 388
			[Serializable]
			public class HeadIK
			{
				// Token: 0x04000C0D RID: 3085
				public float neckLimitPitchUp = 15f;

				// Token: 0x04000C0E RID: 3086
				public float neckLimitPitchDown = 30f;

				// Token: 0x04000C0F RID: 3087
				public float neckLimitRoll = 5f;

				// Token: 0x04000C10 RID: 3088
				public float eyesToNeckPitchRate = 0.4f;

				// Token: 0x04000C11 RID: 3089
				public float headLimitYaw = 60f;

				// Token: 0x04000C12 RID: 3090
				public float headLimitPitchUp = 15f;

				// Token: 0x04000C13 RID: 3091
				public float headLimitPitchDown = 15f;

				// Token: 0x04000C14 RID: 3092
				public float headLimitRoll = 5f;

				// Token: 0x04000C15 RID: 3093
				public float eyesToHeadYawRate = 0.8f;

				// Token: 0x04000C16 RID: 3094
				public float eyesToHeadPitchRate = 0.5f;

				// Token: 0x04000C17 RID: 3095
				public float eyesTraceAngle = 110f;

				// Token: 0x04000C18 RID: 3096
				public float eyesLimitYaw = 40f;

				// Token: 0x04000C19 RID: 3097
				public float eyesLimitPitch = 12f;

				// Token: 0x04000C1A RID: 3098
				public float eyesYawRate = 0.796f;

				// Token: 0x04000C1B RID: 3099
				public float eyesPitchRate = 0.729f;

				// Token: 0x04000C1C RID: 3100
				public float eyesYawOuterRate = 0.356f;

				// Token: 0x04000C1D RID: 3101
				public float eyesYawInnerRate = 0.212f;
			}

			// Token: 0x02000185 RID: 389
			[Serializable]
			public class FingerIK
			{
			}
		}

		// Token: 0x02000186 RID: 390
		[Serializable]
		public class EditorSettings
		{
			// Token: 0x04000C1E RID: 3102
			public bool isAdvanced;

			// Token: 0x04000C1F RID: 3103
			public int toolbarSelected;

			// Token: 0x04000C20 RID: 3104
			public bool isShowEffectorTransform;
		}

		// Token: 0x02000187 RID: 391
		public class InternalValues
		{
			// Token: 0x060007AA RID: 1962 RVA: 0x00002973 File Offset: 0x00000B73
			[Conditional("SAFULLBODYIK_DEBUG")]
			public void ClearDegugPoints()
			{
			}

			// Token: 0x060007AB RID: 1963 RVA: 0x00002973 File Offset: 0x00000B73
			[Conditional("SAFULLBODYIK_DEBUG")]
			public void AddDebugPoint(Vector3 pos)
			{
			}

			// Token: 0x060007AC RID: 1964 RVA: 0x00002973 File Offset: 0x00000B73
			[Conditional("SAFULLBODYIK_DEBUG")]
			public void AddDebugPoint(Vector3 pos, Color color)
			{
			}

			// Token: 0x060007AD RID: 1965 RVA: 0x00002973 File Offset: 0x00000B73
			[Conditional("SAFULLBODYIK_DEBUG")]
			public void AddDebugPoint(Vector3 pos, Color color, float size)
			{
			}

			// Token: 0x060007AE RID: 1966 RVA: 0x00002973 File Offset: 0x00000B73
			[Conditional("SAFULLBODYIK_DEBUG")]
			public void UpdateDebugValue(string name, ref int v)
			{
			}

			// Token: 0x060007AF RID: 1967 RVA: 0x00002973 File Offset: 0x00000B73
			[Conditional("SAFULLBODYIK_DEBUG")]
			public void UpdateDebugValue(string name, ref float v)
			{
			}

			// Token: 0x060007B0 RID: 1968 RVA: 0x00002973 File Offset: 0x00000B73
			[Conditional("SAFULLBODYIK_DEBUG")]
			public void UpdateDebugValue(string name, ref bool v)
			{
			}

			// Token: 0x04000C21 RID: 3105
			public bool animatorEnabled;

			// Token: 0x04000C22 RID: 3106
			public bool resetTransforms;

			// Token: 0x04000C23 RID: 3107
			public bool continuousSolverEnabled;

			// Token: 0x04000C24 RID: 3108
			public int shoulderDirYAsNeck = -1;

			// Token: 0x04000C25 RID: 3109
			public Vector3 defaultRootPosition = Vector3.zero;

			// Token: 0x04000C26 RID: 3110
			public FullBodyIK.Matrix3x3 defaultRootBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C27 RID: 3111
			public FullBodyIK.Matrix3x3 defaultRootBasisInv = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C28 RID: 3112
			public Quaternion defaultRootRotation = Quaternion.identity;

			// Token: 0x04000C29 RID: 3113
			public Vector3 baseHipsPos = Vector3.zero;

			// Token: 0x04000C2A RID: 3114
			public FullBodyIK.Matrix3x3 baseHipsBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C2B RID: 3115
			public FullBodyIK.InternalValues.BodyIK bodyIK = new FullBodyIK.InternalValues.BodyIK();

			// Token: 0x04000C2C RID: 3116
			public FullBodyIK.InternalValues.LimbIK limbIK = new FullBodyIK.InternalValues.LimbIK();

			// Token: 0x04000C2D RID: 3117
			public FullBodyIK.InternalValues.HeadIK headIK = new FullBodyIK.InternalValues.HeadIK();

			// Token: 0x02000188 RID: 392
			public class BodyIK
			{
				// Token: 0x060007B2 RID: 1970 RVA: 0x00042D3C File Offset: 0x00040F3C
				public void Update(FullBodyIK.Settings.BodyIK settingsBodyIK)
				{
					if (this.shoulderLimitThetaYPlus._degrees != settingsBodyIK.shoulderLimitAngleYPlus)
					{
						this.shoulderLimitThetaYPlus._Reset(settingsBodyIK.shoulderLimitAngleYPlus);
					}
					if (this.shoulderLimitThetaYMinus._degrees != settingsBodyIK.shoulderLimitAngleYMinus)
					{
						this.shoulderLimitThetaYMinus._Reset(settingsBodyIK.shoulderLimitAngleYMinus);
					}
					if (this.shoulderLimitThetaZ._degrees != settingsBodyIK.shoulderLimitAngleZ)
					{
						this.shoulderLimitThetaZ._Reset(settingsBodyIK.shoulderLimitAngleZ);
					}
					if (this.upperCenterLegTranslateRate._value != settingsBodyIK.upperCenterLegTranslateRate || this.upperSpineTranslateRate._value != settingsBodyIK.upperSpineTranslateRate)
					{
						this.upperCenterLegTranslateRate._Reset(settingsBodyIK.upperCenterLegTranslateRate);
						this.upperSpineTranslateRate._Reset(Mathf.Max(settingsBodyIK.upperCenterLegTranslateRate, settingsBodyIK.upperSpineTranslateRate));
					}
					if (this.upperPostTranslateRate._value != settingsBodyIK.upperPostTranslateRate)
					{
						this.upperPostTranslateRate._Reset(settingsBodyIK.upperPostTranslateRate);
					}
					if (this.upperCenterLegRotateRate._value != settingsBodyIK.upperCenterLegRotateRate || this.upperSpineRotateRate._value != settingsBodyIK.upperSpineRotateRate)
					{
						this.upperCenterLegRotateRate._Reset(settingsBodyIK.upperCenterLegRotateRate);
						this.upperSpineRotateRate._Reset(Mathf.Max(settingsBodyIK.upperCenterLegRotateRate, settingsBodyIK.upperSpineRotateRate));
						this.isFuzzyUpperCenterLegAndSpineRotationRate = FullBodyIK.IsFuzzy(this.upperCenterLegRotateRate.value, this.upperSpineRotateRate.value, 1E-07f);
					}
					if (this.upperEyesLimitYaw._degrees != settingsBodyIK.upperEyesLimitYaw)
					{
						this.upperEyesLimitYaw._Reset(settingsBodyIK.upperEyesLimitYaw);
					}
					if (this.upperEyesLimitPitchUp._degrees != settingsBodyIK.upperEyesLimitPitchUp)
					{
						this.upperEyesLimitPitchUp._Reset(settingsBodyIK.upperEyesLimitPitchUp);
					}
					if (this.upperEyesLimitPitchDown._degrees != settingsBodyIK.upperEyesLimitPitchDown)
					{
						this.upperEyesLimitPitchDown._Reset(settingsBodyIK.upperEyesLimitPitchDown);
					}
					if (this.upperEyesTraceTheta._degrees != settingsBodyIK.upperEyesTraceAngle)
					{
						this.upperEyesTraceTheta._Reset(settingsBodyIK.upperEyesTraceAngle);
					}
					if (this.spineLimitAngleX._a != settingsBodyIK.spineLimitAngleX)
					{
						this.spineLimitAngleX._Reset(settingsBodyIK.spineLimitAngleX, 0.017453292f);
					}
					if (this.spineLimitAngleY._a != settingsBodyIK.spineLimitAngleY)
					{
						this.spineLimitAngleY._Reset(settingsBodyIK.spineLimitAngleY, 0.017453292f);
					}
					if (this.upperDirXLimitThetaY._degrees != settingsBodyIK.upperDirXLimitAngleY)
					{
						this.upperDirXLimitThetaY._Reset(settingsBodyIK.upperDirXLimitAngleY);
					}
					if (this.upperContinuousPreTranslateRate._value != settingsBodyIK.upperContinuousPreTranslateRate)
					{
						this.upperContinuousPreTranslateRate._Reset(settingsBodyIK.upperContinuousPreTranslateRate);
					}
					if (this.upperContinuousPreTranslateStableRate._value != settingsBodyIK.upperContinuousPreTranslateStableRate)
					{
						this.upperContinuousPreTranslateStableRate._Reset(settingsBodyIK.upperContinuousPreTranslateStableRate);
					}
					if (this.upperContinuousCenterLegRotationStableRate._value != settingsBodyIK.upperContinuousCenterLegRotationStableRate)
					{
						this.upperContinuousCenterLegRotationStableRate._Reset(settingsBodyIK.upperContinuousCenterLegRotationStableRate);
					}
					if (this.upperContinuousPostTranslateStableRate._value != settingsBodyIK.upperContinuousPostTranslateStableRate)
					{
						this.upperContinuousPostTranslateStableRate._Reset(settingsBodyIK.upperContinuousPostTranslateStableRate);
					}
				}

				// Token: 0x04000C2E RID: 3118
				public FullBodyIK.CachedDegreesToSin shoulderLimitThetaYPlus = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C2F RID: 3119
				public FullBodyIK.CachedDegreesToSin shoulderLimitThetaYMinus = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C30 RID: 3120
				public FullBodyIK.CachedDegreesToSin shoulderLimitThetaZ = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C31 RID: 3121
				public FullBodyIK.CachedRate01 upperCenterLegTranslateRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C32 RID: 3122
				public FullBodyIK.CachedRate01 upperSpineTranslateRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C33 RID: 3123
				public FullBodyIK.CachedRate01 upperPreTranslateRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C34 RID: 3124
				public FullBodyIK.CachedRate01 upperPostTranslateRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C35 RID: 3125
				public FullBodyIK.CachedRate01 upperCenterLegRotateRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C36 RID: 3126
				public FullBodyIK.CachedRate01 upperSpineRotateRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C37 RID: 3127
				public bool isFuzzyUpperCenterLegAndSpineRotationRate = true;

				// Token: 0x04000C38 RID: 3128
				public FullBodyIK.CachedDegreesToSin upperEyesLimitYaw = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C39 RID: 3129
				public FullBodyIK.CachedDegreesToSin upperEyesLimitPitchUp = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C3A RID: 3130
				public FullBodyIK.CachedDegreesToSin upperEyesLimitPitchDown = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C3B RID: 3131
				public FullBodyIK.CachedDegreesToCos upperEyesTraceTheta = FullBodyIK.CachedDegreesToCos.zero;

				// Token: 0x04000C3C RID: 3132
				public FullBodyIK.CachedDegreesToSin upperDirXLimitThetaY = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C3D RID: 3133
				public FullBodyIK.CachedScaledValue spineLimitAngleX = FullBodyIK.CachedScaledValue.zero;

				// Token: 0x04000C3E RID: 3134
				public FullBodyIK.CachedScaledValue spineLimitAngleY = FullBodyIK.CachedScaledValue.zero;

				// Token: 0x04000C3F RID: 3135
				public FullBodyIK.CachedRate01 upperContinuousPreTranslateRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C40 RID: 3136
				public FullBodyIK.CachedRate01 upperContinuousPreTranslateStableRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C41 RID: 3137
				public FullBodyIK.CachedRate01 upperContinuousCenterLegRotationStableRate = FullBodyIK.CachedRate01.zero;

				// Token: 0x04000C42 RID: 3138
				public FullBodyIK.CachedRate01 upperContinuousPostTranslateStableRate = FullBodyIK.CachedRate01.zero;
			}

			// Token: 0x02000189 RID: 393
			public class LimbIK
			{
				// Token: 0x060007B4 RID: 1972 RVA: 0x0004310C File Offset: 0x0004130C
				public void Update(FullBodyIK.Settings.LimbIK settingsLimbIK)
				{
					if (this.armEffectorBackBeginTheta._degrees != settingsLimbIK.armEffectorBackBeginAngle)
					{
						this.armEffectorBackBeginTheta._Reset(settingsLimbIK.armEffectorBackBeginAngle);
					}
					if (this.armEffectorBackCoreBeginTheta._degrees != settingsLimbIK.armEffectorBackCoreBeginAngle)
					{
						this.armEffectorBackCoreBeginTheta._Reset(settingsLimbIK.armEffectorBackCoreBeginAngle);
					}
					if (this.armEffectorBackCoreEndTheta._degrees != settingsLimbIK.armEffectorBackCoreEndAngle)
					{
						this.armEffectorBackCoreEndTheta._Reset(settingsLimbIK.armEffectorBackCoreEndAngle);
					}
					if (this.armEffectorBackEndTheta._degrees != settingsLimbIK.armEffectorBackEndAngle)
					{
						this.armEffectorBackEndTheta._Reset(settingsLimbIK.armEffectorBackEndAngle);
					}
					if (this.armEffectorBackCoreUpperTheta._degrees != settingsLimbIK.armEffectorBackCoreUpperAngle)
					{
						this.armEffectorBackCoreUpperTheta._Reset(settingsLimbIK.armEffectorBackCoreUpperAngle);
					}
					if (this.armEffectorBackCoreLowerTheta._degrees != settingsLimbIK.armEffectorBackCoreLowerAngle)
					{
						this.armEffectorBackCoreLowerTheta._Reset(settingsLimbIK.armEffectorBackCoreLowerAngle);
					}
					if (this.elbowFrontInnerLimitTheta._degrees != settingsLimbIK.elbowFrontInnerLimitAngle)
					{
						this.elbowFrontInnerLimitTheta._Reset(settingsLimbIK.elbowFrontInnerLimitAngle);
					}
					if (this.elbowBackInnerLimitTheta._degrees != settingsLimbIK.elbowBackInnerLimitAngle)
					{
						this.elbowBackInnerLimitTheta._Reset(settingsLimbIK.elbowBackInnerLimitAngle);
					}
					if (this.footLimitYawTheta._degrees != settingsLimbIK.footLimitYaw)
					{
						this.footLimitYawTheta._Reset(settingsLimbIK.footLimitYaw);
					}
					if (this.footLimitPitchUpTheta._degrees != settingsLimbIK.footLimitPitchUp)
					{
						this.footLimitPitchUpTheta._Reset(settingsLimbIK.footLimitPitchUp);
					}
					if (this.footLimitPitchDownTheta._degrees != settingsLimbIK.footLimitPitchDown)
					{
						this.footLimitPitchDownTheta._Reset(settingsLimbIK.footLimitPitchDown);
					}
					if (this.footLimitRollTheta._degrees != settingsLimbIK.footLimitRoll)
					{
						this.footLimitRollTheta._Reset(settingsLimbIK.footLimitRoll);
					}
				}

				// Token: 0x04000C43 RID: 3139
				public FullBodyIK.CachedDegreesToSin armEffectorBackBeginTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C44 RID: 3140
				public FullBodyIK.CachedDegreesToSin armEffectorBackCoreBeginTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C45 RID: 3141
				public FullBodyIK.CachedDegreesToCos armEffectorBackCoreEndTheta = FullBodyIK.CachedDegreesToCos.zero;

				// Token: 0x04000C46 RID: 3142
				public FullBodyIK.CachedDegreesToCos armEffectorBackEndTheta = FullBodyIK.CachedDegreesToCos.zero;

				// Token: 0x04000C47 RID: 3143
				public FullBodyIK.CachedDegreesToSin armEffectorBackCoreUpperTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C48 RID: 3144
				public FullBodyIK.CachedDegreesToSin armEffectorBackCoreLowerTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C49 RID: 3145
				public FullBodyIK.CachedDegreesToSin elbowFrontInnerLimitTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C4A RID: 3146
				public FullBodyIK.CachedDegreesToSin elbowBackInnerLimitTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C4B RID: 3147
				public FullBodyIK.CachedDegreesToSin footLimitYawTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C4C RID: 3148
				public FullBodyIK.CachedDegreesToSin footLimitPitchUpTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C4D RID: 3149
				public FullBodyIK.CachedDegreesToSin footLimitPitchDownTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C4E RID: 3150
				public FullBodyIK.CachedDegreesToSin footLimitRollTheta = FullBodyIK.CachedDegreesToSin.zero;
			}

			// Token: 0x0200018A RID: 394
			public class HeadIK
			{
				// Token: 0x060007B6 RID: 1974 RVA: 0x00043374 File Offset: 0x00041574
				public void Update(FullBodyIK.Settings.HeadIK settingsHeadIK)
				{
					if (this.neckLimitPitchUpTheta._degrees != settingsHeadIK.neckLimitPitchUp)
					{
						this.neckLimitPitchUpTheta._Reset(settingsHeadIK.neckLimitPitchUp);
					}
					if (this.neckLimitPitchDownTheta._degrees != settingsHeadIK.neckLimitPitchDown)
					{
						this.neckLimitPitchDownTheta._Reset(settingsHeadIK.neckLimitPitchDown);
					}
					if (this.neckLimitRollTheta._degrees != settingsHeadIK.neckLimitRoll)
					{
						this.neckLimitRollTheta._Reset(settingsHeadIK.neckLimitRoll);
					}
					if (this.headLimitYawTheta._degrees != settingsHeadIK.headLimitYaw)
					{
						this.headLimitYawTheta._Reset(settingsHeadIK.headLimitYaw);
					}
					if (this.headLimitPitchUpTheta._degrees != settingsHeadIK.headLimitPitchUp)
					{
						this.headLimitPitchUpTheta._Reset(settingsHeadIK.headLimitPitchUp);
					}
					if (this.headLimitPitchDownTheta._degrees != settingsHeadIK.headLimitPitchDown)
					{
						this.headLimitPitchDownTheta._Reset(settingsHeadIK.headLimitPitchDown);
					}
					if (this.headLimitRollTheta._degrees != settingsHeadIK.headLimitRoll)
					{
						this.headLimitRollTheta._Reset(settingsHeadIK.headLimitRoll);
					}
					if (this.eyesTraceTheta._degrees != settingsHeadIK.eyesTraceAngle)
					{
						this.eyesTraceTheta._Reset(settingsHeadIK.eyesTraceAngle);
					}
					if (this.eyesLimitYawTheta._degrees != settingsHeadIK.eyesLimitYaw)
					{
						this.eyesLimitYawTheta._Reset(settingsHeadIK.eyesLimitYaw);
					}
					if (this.eyesLimitPitchTheta._degrees != settingsHeadIK.eyesLimitPitch)
					{
						this.eyesLimitPitchTheta._Reset(settingsHeadIK.eyesLimitPitch);
					}
				}

				// Token: 0x04000C4F RID: 3151
				public FullBodyIK.CachedDegreesToSin neckLimitPitchUpTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C50 RID: 3152
				public FullBodyIK.CachedDegreesToSin neckLimitPitchDownTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C51 RID: 3153
				public FullBodyIK.CachedDegreesToSin neckLimitRollTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C52 RID: 3154
				public FullBodyIK.CachedDegreesToSin headLimitYawTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C53 RID: 3155
				public FullBodyIK.CachedDegreesToSin headLimitPitchUpTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C54 RID: 3156
				public FullBodyIK.CachedDegreesToSin headLimitPitchDownTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C55 RID: 3157
				public FullBodyIK.CachedDegreesToSin headLimitRollTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C56 RID: 3158
				public FullBodyIK.CachedDegreesToCos eyesTraceTheta = FullBodyIK.CachedDegreesToCos.zero;

				// Token: 0x04000C57 RID: 3159
				public FullBodyIK.CachedDegreesToSin eyesLimitYawTheta = FullBodyIK.CachedDegreesToSin.zero;

				// Token: 0x04000C58 RID: 3160
				public FullBodyIK.CachedDegreesToSin eyesLimitPitchTheta = FullBodyIK.CachedDegreesToSin.zero;
			}
		}

		// Token: 0x0200018B RID: 395
		public class BoneCaches
		{
			// Token: 0x060007B8 RID: 1976 RVA: 0x00043534 File Offset: 0x00041734
			private void _PrepareHipsToFootLength(int index, FullBodyIK.Bone legBone, FullBodyIK.Bone kneeBone, FullBodyIK.Bone footBone, FullBodyIK.InternalValues internalValues)
			{
				if (legBone != null && kneeBone != null && footBone != null)
				{
					float length = legBone._defaultLocalLength.length;
					float length2 = kneeBone._defaultLocalLength.length;
					float length3 = footBone._defaultLocalLength.length;
					Vector3 defaultLocalDirection = legBone._defaultLocalDirection;
					Vector3 defaultLocalDirection2 = kneeBone._defaultLocalDirection;
					Vector3 defaultLocalDirection3 = footBone._defaultLocalDirection;
					FullBodyIK.SAFBIKMatMultVec(out this.hipsToFootLength[index].hipsToLeg, ref internalValues.defaultRootBasisInv, ref defaultLocalDirection);
					FullBodyIK.SAFBIKMatMultVec(out this.hipsToFootLength[index].legToKnee, ref internalValues.defaultRootBasisInv, ref defaultLocalDirection2);
					FullBodyIK.SAFBIKMatMultVec(out this.hipsToFootLength[index].kneeToFoot, ref internalValues.defaultRootBasisInv, ref defaultLocalDirection3);
					this.hipsToFootLength[index].defaultOffset = this.hipsToFootLength[index].hipsToLeg * length + this.hipsToFootLength[index].legToKnee * length2 + this.hipsToFootLength[index].kneeToFoot * length3;
				}
			}

			// Token: 0x060007B9 RID: 1977 RVA: 0x00043650 File Offset: 0x00041850
			private Vector3 _GetHipsOffset(int index, FullBodyIK.Bone legBone, FullBodyIK.Bone kneeBone, FullBodyIK.Bone footBone)
			{
				if (legBone != null && kneeBone != null && footBone != null)
				{
					float length = legBone._defaultLocalLength.length;
					float length2 = kneeBone._defaultLocalLength.length;
					float length3 = footBone._defaultLocalLength.length;
					Vector3 a = this.hipsToFootLength[index].hipsToLeg * length + this.hipsToFootLength[index].legToKnee * length2 + this.hipsToFootLength[index].kneeToFoot * length3;
					return a - this.hipsToFootLength[index].defaultOffset;
				}
				return Vector3.zero;
			}

			// Token: 0x060007BA RID: 1978 RVA: 0x00043704 File Offset: 0x00041904
			public void Prepare(FullBodyIK fullBodyIK)
			{
				this._PrepareHipsToFootLength(0, fullBodyIK.leftLegBones.leg, fullBodyIK.leftLegBones.knee, fullBodyIK.leftLegBones.foot, fullBodyIK.internalValues);
				this._PrepareHipsToFootLength(1, fullBodyIK.rightLegBones.leg, fullBodyIK.rightLegBones.knee, fullBodyIK.rightLegBones.foot, fullBodyIK.internalValues);
				if (fullBodyIK.bodyBones.hips != null)
				{
					this.defaultHipsPosition = fullBodyIK.bodyBones.hips._defaultPosition;
				}
			}

			// Token: 0x060007BB RID: 1979 RVA: 0x00043794 File Offset: 0x00041994
			public void _SyncDisplacement(FullBodyIK fullBodyIK)
			{
				Vector3 a = this._GetHipsOffset(0, fullBodyIK.leftLegBones.leg, fullBodyIK.leftLegBones.knee, fullBodyIK.leftLegBones.foot);
				Vector3 b = this._GetHipsOffset(1, fullBodyIK.rightLegBones.leg, fullBodyIK.rightLegBones.knee, fullBodyIK.rightLegBones.foot);
				this.hipsOffset = (a + b) * 0.5f;
			}

			// Token: 0x04000C59 RID: 3161
			public FullBodyIK.BoneCaches.HipsToFootLength[] hipsToFootLength = new FullBodyIK.BoneCaches.HipsToFootLength[2];

			// Token: 0x04000C5A RID: 3162
			public Vector3 defaultHipsPosition = Vector3.zero;

			// Token: 0x04000C5B RID: 3163
			public Vector3 hipsOffset = Vector3.zero;

			// Token: 0x0200018C RID: 396
			public struct HipsToFootLength
			{
				// Token: 0x04000C5C RID: 3164
				public Vector3 hipsToLeg;

				// Token: 0x04000C5D RID: 3165
				public Vector3 legToKnee;

				// Token: 0x04000C5E RID: 3166
				public Vector3 kneeToFoot;

				// Token: 0x04000C5F RID: 3167
				public Vector3 defaultOffset;
			}
		}

		// Token: 0x0200018D RID: 397
		public class BodyIK
		{
			// Token: 0x060007BC RID: 1980 RVA: 0x0004380C File Offset: 0x00041A0C
			public BodyIK(FullBodyIK fullBodyIK, FullBodyIK.LimbIK[] limbIK)
			{
				this._limbIK = limbIK;
				this._settings = fullBodyIK.settings;
				this._internalValues = fullBodyIK.internalValues;
				this._hipsBone = FullBodyIK._PrepareBone(fullBodyIK.bodyBones.hips);
				this._neckBone = FullBodyIK._PrepareBone(fullBodyIK.headBones.neck);
				this._headBone = FullBodyIK._PrepareBone(fullBodyIK.headBones.head);
				this._hipsEffector = fullBodyIK.bodyEffectors.hips;
				this._neckEffector = fullBodyIK.headEffectors.neck;
				this._headEffector = fullBodyIK.headEffectors.head;
				this._eyesEffector = fullBodyIK.headEffectors.eyes;
				this._armEffectors[0] = fullBodyIK.leftArmEffectors.arm;
				this._armEffectors[1] = fullBodyIK.rightArmEffectors.arm;
				this._elbowEffectors[0] = fullBodyIK.leftArmEffectors.elbow;
				this._elbowEffectors[1] = fullBodyIK.rightArmEffectors.elbow;
				this._wristEffectors[0] = fullBodyIK.leftArmEffectors.wrist;
				this._wristEffectors[1] = fullBodyIK.rightArmEffectors.wrist;
				this._kneeEffectors[0] = fullBodyIK.leftLegEffectors.knee;
				this._kneeEffectors[1] = fullBodyIK.rightLegEffectors.knee;
				this._footEffectors[0] = fullBodyIK.leftLegEffectors.foot;
				this._footEffectors[1] = fullBodyIK.rightLegEffectors.foot;
				this._spineBones = FullBodyIK.BodyIK._PrepareSpineBones(fullBodyIK.bones);
				if (this._spineBones != null && this._spineBones.Length > 0)
				{
					int num = this._spineBones.Length;
					this._spineBone = this._spineBones[0];
					this._spineUBone = this._spineBones[num - 1];
					this._spineEnabled = new bool[num];
				}
				this._kneeBones = FullBodyIK._PrepareBones(fullBodyIK.leftLegBones.knee, fullBodyIK.rightLegBones.knee);
				this._elbowBones = FullBodyIK._PrepareBones(fullBodyIK.leftArmBones.elbow, fullBodyIK.rightArmBones.elbow);
				this._legBones = FullBodyIK._PrepareBones(fullBodyIK.leftLegBones.leg, fullBodyIK.rightLegBones.leg);
				this._armBones = FullBodyIK._PrepareBones(fullBodyIK.leftArmBones.arm, fullBodyIK.rightArmBones.arm);
				this._shoulderBones = FullBodyIK._PrepareBones(fullBodyIK.leftArmBones.shoulder, fullBodyIK.rightArmBones.shoulder);
				this._nearArmBones = ((this._shoulderBones == null) ? this._nearArmBones : this._shoulderBones);
				this._Prepare(fullBodyIK);
			}

			// Token: 0x060007BD RID: 1981 RVA: 0x00043BA0 File Offset: 0x00041DA0
			private static FullBodyIK.Bone[] _PrepareSpineBones(FullBodyIK.Bone[] bones)
			{
				if (bones == null || bones.Length != 79)
				{
					return null;
				}
				int num = 0;
				for (int i = 1; i <= 4; i++)
				{
					if (bones[i] != null && bones[i].transformIsAlive)
					{
						num++;
					}
				}
				if (num == 0)
				{
					return null;
				}
				FullBodyIK.Bone[] array = new FullBodyIK.Bone[num];
				int num2 = 0;
				for (int j = 1; j <= 4; j++)
				{
					if (bones[j] != null && bones[j].transformIsAlive)
					{
						array[num2] = bones[j];
						num2++;
					}
				}
				return array;
			}

			// Token: 0x060007BE RID: 1982 RVA: 0x00043C38 File Offset: 0x00041E38
			private void _Prepare(FullBodyIK fullBodyIK)
			{
				if (this._spineBones != null)
				{
					int num = this._spineBones.Length;
					this._spineDirXRate = new float[num];
					if (num > 1)
					{
						this._spinePrevCenterArmToChildBasis = new FullBodyIK.Matrix3x3[num - 1];
						this._spineCenterArmToChildBasis = new FullBodyIK.Matrix3x3[num - 1];
						for (int num2 = 0; num2 != num - 1; num2++)
						{
							this._spinePrevCenterArmToChildBasis[num2] = FullBodyIK.Matrix3x3.identity;
							this._spineCenterArmToChildBasis[num2] = FullBodyIK.Matrix3x3.identity;
						}
					}
				}
			}

			// Token: 0x060007BF RID: 1983 RVA: 0x00043CC8 File Offset: 0x00041EC8
			private void _SyncDisplacement()
			{
				if (this._settings.syncDisplacement == FullBodyIK.SyncDisplacement.Everyframe || !this._isSyncDisplacementAtLeastOnce)
				{
					this._isSyncDisplacementAtLeastOnce = true;
					if (this._shoulderBones != null)
					{
						for (int num = 0; num != 2; num++)
						{
							Vector3 column = this._shoulderBones[num]._localAxisBasis.column1;
							this._shouderLocalAxisYInv[num] = (Vector3.Dot(column, this._internalValues.defaultRootBasis.column1) < 0f);
						}
					}
					if (this._eyesEffector != null)
					{
						this._defaultCenterEyePos = this._eyesEffector.defaultPosition;
					}
					if (this._legBones != null)
					{
						this._defaultCenterLegPos = (this._legBones[0]._defaultPosition + this._legBones[1]._defaultPosition) * 0.5f;
					}
					if (this._nearArmBones != null)
					{
						this._defaultCenterArmPos = (this._nearArmBones[1]._defaultPosition + this._nearArmBones[0]._defaultPosition) * 0.5f;
						Vector3 vector = this._nearArmBones[1]._defaultPosition - this._nearArmBones[0]._defaultPosition;
						Vector3 vector2 = this._defaultCenterArmPos - this._defaultCenterLegPos;
						if (FullBodyIK.SAFBIKVecNormalize(ref vector2) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out this._centerLegToArmBasis, ref vector, ref vector2))
						{
							this._centerLegToArmBasisInv = this._centerLegToArmBasis.transpose;
							FullBodyIK.SAFBIKMatMult(out this._centerLegToArmBoneToBaseBasis, ref this._centerLegToArmBasisInv, ref this._internalValues.defaultRootBasis);
							this._centerLegToArmBaseToBoneBasis = this._centerLegToArmBoneToBaseBasis.transpose;
						}
					}
					this._solverCaches.armBones = this._armBones;
					this._solverCaches.shoulderBones = this._shoulderBones;
					this._solverCaches.nearArmBones = this._nearArmBones;
					this._solverCaches.centerLegToNearArmBasis = this._centerLegToArmBasis;
					this._solverCaches.centerLegToNearArmBasisInv = this._centerLegToArmBasisInv;
					this._solverCaches.centerLegToNaerArmBoneToBaseBasis = this._centerLegToArmBoneToBaseBasis;
					this._solverCaches.centerLegToNaerArmBaseToBoneBasis = this._centerLegToArmBaseToBoneBasis;
					this._solverCaches.defaultCenterLegPos = this._defaultCenterLegPos;
					this._defaultCenterLegToCeterArmLen = FullBodyIK.SAFBIKVecLength2(ref this._defaultCenterLegPos, ref this._defaultCenterArmPos);
					if (this._footEffectors != null && this._footEffectors[0].bone != null && this._footEffectors[1].bone != null)
					{
						this._defaultCenterLegLen = FullBodyIK.SAFBIKVecLength2(ref this._footEffectors[0].bone._defaultPosition, ref this._footEffectors[1].bone._defaultPosition);
						this._defaultCenterLegHalfLen = this._defaultCenterLegLen * 0.5f;
					}
					if (this._spineBone != null && this._legBones != null && FullBodyIK.BodyIK._ComputeCenterLegBasis(out this._centerLegBoneBasis, ref this._spineBone._defaultPosition, ref this._legBones[0]._defaultPosition, ref this._legBones[1]._defaultPosition))
					{
						this._centerLegBoneBasisInv = this._centerLegBoneBasis.transpose;
					}
					if (this._armBones != null)
					{
						if (this._shoulderBones != null)
						{
							for (int num2 = 0; num2 != 2; num2++)
							{
								this._shoulderToArmLength[num2] = this._armBones[num2]._defaultLocalLength.length;
							}
						}
						this._solverCaches.armToArmLen = FullBodyIK.SAFBIKVecLength2(ref this._armBones[0]._defaultPosition, ref this._armBones[1]._defaultPosition);
					}
					if (this._nearArmBones != null)
					{
						this._defaultNearArmToNearArmLen = FullBodyIK.SAFBIKVecLength2(ref this._nearArmBones[0]._defaultPosition, ref this._nearArmBones[1]._defaultPosition);
						if (this._neckBone != null && this._neckBone.transformIsAlive)
						{
							this._solverCaches.nearArmToNeckLength[0] = FullBodyIK.SAFBIKVecLength2(ref this._neckBone._defaultPosition, ref this._nearArmBones[0]._defaultPosition);
							this._solverCaches.nearArmToNeckLength[1] = FullBodyIK.SAFBIKVecLength2(ref this._neckBone._defaultPosition, ref this._nearArmBones[1]._defaultPosition);
						}
					}
					if (this._neckBone != null && this._headBone != null)
					{
						this._solverCaches.neckToHeadLength = FullBodyIK.SAFBIKVecLength2(ref this._neckBone._defaultPosition, ref this._headBone._defaultPosition);
					}
					this._solverCaches.shoulderToArmLength = this._shoulderToArmLength;
					this._solverCaches.nearArmToNearArmLen = this._defaultNearArmToNearArmLen;
					if (this._kneeBones != null && this._footEffectors != null)
					{
						for (int num3 = 0; num3 != 2; num3++)
						{
							FullBodyIK.Bone bone = this._kneeBones[num3];
							FullBodyIK.Bone bone2 = this._footEffectors[num3].bone;
							this._kneeEffectorMaxLength[num3] = bone._defaultLocalLength;
							this._footEffectorMaxLength[num3] = FullBodyIK.FastLength.FromLength(bone._defaultLocalLength.length + bone2._defaultLocalLength.length);
						}
					}
					if (this._elbowBones != null && this._wristEffectors != null)
					{
						for (int num4 = 0; num4 != 2; num4++)
						{
							FullBodyIK.Bone bone3 = this._elbowBones[num4];
							FullBodyIK.Bone bone4 = this._wristEffectors[num4].bone;
							this._elbowEffectorMaxLength[num4] = bone3._defaultLocalLength;
							this._wristEffectorMaxLength[num4] = FullBodyIK.FastLength.FromLength(bone3._defaultLocalLength.length + bone4._defaultLocalLength.length);
						}
					}
					if (this._spineBones != null && (this._nearArmBones != null || this._legBones != null) && this._neckBone != null && this._neckBone.transformIsAlive)
					{
						Vector3 column2 = this._internalValues.defaultRootBasis.column0;
						int num5 = this._spineBones.Length;
						for (int i = 0; i < num5 - 1; i++)
						{
							Vector3 b = (i == 0) ? this._defaultCenterLegPos : this._spineBones[i - 1]._defaultPosition;
							Vector3 vector3 = this._defaultCenterArmPos - b;
							Vector3 vector4 = this._defaultCenterArmPos - this._spineBones[i]._defaultPosition;
							if (FullBodyIK.SAFBIKVecNormalize2(ref vector3, ref vector4))
							{
								FullBodyIK.Matrix3x3 matrix3x;
								FullBodyIK.Matrix3x3 matrix3x2;
								if (FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x, ref column2, ref vector3) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x2, ref column2, ref vector4))
								{
									FullBodyIK.SAFBIKMatMultInv0(out this._spinePrevCenterArmToChildBasis[i], ref matrix3x, ref this._spineBones[i]._localAxisBasis);
									FullBodyIK.SAFBIKMatMultInv0(out this._spineCenterArmToChildBasis[i], ref matrix3x2, ref this._spineBones[i]._localAxisBasis);
								}
							}
						}
					}
				}
			}

			// Token: 0x060007C0 RID: 1984 RVA: 0x000443A4 File Offset: 0x000425A4
			public bool Solve()
			{
				if (!this._IsEffectorEnabled() && !this._settings.bodyIK.forceSolveEnabled)
				{
					return false;
				}
				this._SyncDisplacement();
				if (!this._PrepareSolverInternal())
				{
					return false;
				}
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				if (!this._internalValues.resetTransforms)
				{
					if (solverInternal.spinePos != null)
					{
						for (int num = 0; num != this._spineBones.Length; num++)
						{
							if (this._spineBones[num] != null)
							{
								solverInternal.spinePos[num] = this._spineBones[num].worldPosition;
							}
						}
					}
					if (this._neckBone != null)
					{
						solverInternal.neckPos = this._neckBone.worldPosition;
					}
					if (this._headBone != null)
					{
						solverInternal.headPos = this._headBone.worldPosition;
					}
					if (solverInternal.shoulderPos != null)
					{
						for (int i = 0; i < 2; i++)
						{
							solverInternal.shoulderPos[i] = this._shoulderBones[i].worldPosition;
						}
					}
					if (solverInternal.armPos != null)
					{
						for (int num2 = 0; num2 != 2; num2++)
						{
							solverInternal.armPos[num2] = this._armBones[num2].worldPosition;
						}
					}
					if (solverInternal.legPos != null)
					{
						for (int num3 = 0; num3 != 2; num3++)
						{
							solverInternal.legPos[num3] = this._legBones[num3].worldPosition;
						}
					}
					solverInternal.SetDirtyVariables();
				}
				if (this._internalValues.resetTransforms)
				{
					this._ResetTransforms();
				}
				else if (this._internalValues.animatorEnabled)
				{
					this._PresolveHips();
				}
				if (!this._internalValues.resetTransforms && this._settings.bodyIK.shoulderSolveEnabled)
				{
					this._ResetShoulderTransform();
				}
				this._solverInternal.arms.Prepare(this._elbowEffectors, this._wristEffectors);
				this._solverInternal.legs.Prepare(this._kneeEffectors, this._footEffectors);
				if (this._settings.bodyIK.lowerSolveEnabled)
				{
					this._LowerSolve(true);
				}
				if (this._settings.bodyIK.upperSolveEnabled)
				{
					this._UpperSolve();
				}
				if (this._settings.bodyIK.lowerSolveEnabled)
				{
					this._LowerSolve(false);
				}
				if (this._settings.bodyIK.shoulderSolveEnabled)
				{
					this._ShoulderResolve();
				}
				if (this._settings.bodyIK.computeWorldTransform)
				{
					this._ComputeWorldTransform();
				}
				return true;
			}

			// Token: 0x060007C1 RID: 1985 RVA: 0x00044668 File Offset: 0x00042868
			private bool _UpperSolve()
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				float num = (!this._hipsEffector.positionEnabled) ? 0f : this._hipsEffector.pull;
				float neckPull = this._solverCaches.neckPull;
				float headPull = this._solverCaches.headPull;
				float eyesRate = this._solverCaches.eyesRate;
				float[] armPull = this._solverCaches.armPull;
				float[] elbowPull = this._solverCaches.elbowPull;
				float[] wristPull = this._solverCaches.wristPull;
				if (!this._settings.bodyIK.forceSolveEnabled)
				{
					if (num <= 1E-07f && neckPull <= 1E-07f && headPull <= 1E-07f && eyesRate <= 1E-07f && armPull[0] <= 1E-07f && armPull[1] <= 1E-07f && elbowPull[0] <= 1E-07f && elbowPull[1] <= 1E-07f && wristPull[0] <= 1E-07f && wristPull[1] <= 1E-07f)
					{
						return false;
					}
				}
				Vector3 zero = Vector3.zero;
				bool continuousSolverEnabled = this._internalValues.continuousSolverEnabled;
				if (continuousSolverEnabled)
				{
					FullBodyIK.Matrix3x3 matrix3x;
					this._UpperSolve_PresolveBaseCenterLegTransform(out zero, out matrix3x);
					solverInternal.Backup();
					if (this._spineBones != null)
					{
						for (int i = 0; i < this._spineBones.Length; i++)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.spinePos[i], ref matrix3x, ref this._spineBones[i]._defaultPosition, ref this._defaultCenterLegPos, ref zero);
						}
					}
					if (this._neckBone != null)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.neckPos, ref matrix3x, ref this._neckBone._defaultPosition, ref this._defaultCenterLegPos, ref zero);
					}
					if (this._headBone != null && solverInternal.headEnabled)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.headPos, ref matrix3x, ref this._headBone._defaultPosition, ref this._defaultCenterLegPos, ref zero);
					}
					for (int j = 0; j < 2; j++)
					{
						if (this._shoulderBones != null)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.shoulderPos[j], ref matrix3x, ref this._shoulderBones[j]._defaultPosition, ref this._defaultCenterLegPos, ref zero);
						}
						if (this._armBones != null)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.armPos[j], ref matrix3x, ref this._armBones[j]._defaultPosition, ref this._defaultCenterLegPos, ref zero);
						}
						if (this._legBones != null)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.legPos[j], ref matrix3x, ref this._legBones[j]._defaultPosition, ref this._defaultCenterLegPos, ref zero);
						}
					}
					solverInternal.SetDirtyVariables();
				}
				solverInternal.UpperSolve();
				float value = this._internalValues.bodyIK.upperCenterLegRotateRate.value;
				float value2 = this._internalValues.bodyIK.upperSpineRotateRate.value;
				float value3 = this._internalValues.bodyIK.upperCenterLegTranslateRate.value;
				float value4 = this._internalValues.bodyIK.upperSpineTranslateRate.value;
				Vector3 targetCenterArmPos = solverInternal.targetCenterArmPos;
				Vector3 targetCenterArmDir = solverInternal.targetCenterArmDir;
				Vector3 currentCenterArmPos = solverInternal.currentCenterArmPos;
				Vector3 currentCenterArmDir = solverInternal.currentCenterArmDir;
				Vector3 vector = FullBodyIK._LerpDir(ref currentCenterArmDir, ref targetCenterArmDir, value);
				Vector3 vector2 = FullBodyIK._LerpDir(ref currentCenterArmDir, ref targetCenterArmDir, value2);
				Vector3 a = Vector3.Lerp(currentCenterArmPos, targetCenterArmPos, value3);
				Vector3 a2 = Vector3.Lerp(currentCenterArmPos, targetCenterArmPos, value4);
				Vector3 vector3 = a - solverInternal.centerLegPos;
				Vector3 vector4 = a2 - solverInternal.centerLegPos;
				if (!FullBodyIK.SAFBIKVecNormalize2(ref vector3, ref vector4))
				{
					return false;
				}
				if (this._settings.bodyIK.upperDirXLimitEnabled)
				{
					if (this._internalValues.bodyIK.upperDirXLimitThetaY.sin <= 1E-07f)
					{
						if (!FullBodyIK._FitToPlaneDir(ref vector, vector3) || !FullBodyIK._FitToPlaneDir(ref vector2, vector4))
						{
							return false;
						}
					}
					else if (!FullBodyIK._LimitToPlaneDirY(ref vector, vector3, this._internalValues.bodyIK.upperDirXLimitThetaY.sin) || !FullBodyIK._LimitToPlaneDirY(ref vector2, vector4, this._internalValues.bodyIK.upperDirXLimitThetaY.sin))
					{
						return false;
					}
				}
				if (this._settings.bodyIK.spineLimitEnabled)
				{
					float value5 = this._internalValues.bodyIK.spineLimitAngleX.value;
					float value6 = this._internalValues.bodyIK.spineLimitAngleY.value;
					if (this._settings.bodyIK.spineAccurateLimitEnabled)
					{
						float cos = Vector3.Dot(vector, vector2);
						float num2 = FullBodyIK.SAFBIKAcos(cos);
						if (num2 > value5)
						{
							Vector3 axis = Vector3.Cross(vector, vector2);
							if (FullBodyIK.SAFBIKVecNormalize(ref axis))
							{
								Quaternion quaternion = Quaternion.AngleAxis(this._settings.bodyIK.spineLimitAngleX, axis);
								FullBodyIK.Matrix3x3 matrix3x2;
								FullBodyIK.SAFBIKMatSetRot(out matrix3x2, ref quaternion);
								FullBodyIK.SAFBIKMatMultVec(out vector2, ref matrix3x2, ref vector);
							}
						}
						float cos2 = Vector3.Dot(vector3, vector4);
						float num3 = FullBodyIK.SAFBIKAcos(cos2);
						if (num3 > value6)
						{
							Vector3 axis2 = Vector3.Cross(vector3, vector4);
							if (FullBodyIK.SAFBIKVecNormalize(ref axis2))
							{
								Quaternion quaternion2 = Quaternion.AngleAxis(this._settings.bodyIK.spineLimitAngleY, axis2);
								FullBodyIK.Matrix3x3 matrix3x3;
								FullBodyIK.SAFBIKMatSetRot(out matrix3x3, ref quaternion2);
								FullBodyIK.SAFBIKMatMultVec(out vector4, ref matrix3x3, ref vector3);
							}
						}
					}
					else
					{
						float cos3 = Vector3.Dot(vector, vector2);
						float num4 = FullBodyIK.SAFBIKAcos(cos3);
						if (num4 > value5 && num4 > 1E-07f)
						{
							float t = value5 / num4;
							Vector3 vector5 = Vector3.Lerp(vector, vector2, t);
							if (FullBodyIK.SAFBIKVecNormalize(ref vector5))
							{
								vector2 = vector5;
							}
						}
						float cos4 = Vector3.Dot(vector3, vector4);
						float num5 = FullBodyIK.SAFBIKAcos(cos4);
						if (num5 > value6 && num5 > 1E-07f)
						{
							float t2 = value6 / num5;
							Vector3 vector6 = Vector3.Lerp(vector3, vector4, t2);
							if (FullBodyIK.SAFBIKVecNormalize(ref vector6))
							{
								vector4 = vector6;
							}
						}
					}
				}
				Vector3 centerLegPos = solverInternal.centerLegPos;
				Vector3 a3 = solverInternal.centerLegPos;
				if (eyesRate > 1E-07f)
				{
					Vector3 b = solverInternal.centerLegPos + vector4 * this._defaultCenterLegToCeterArmLen;
					a3 += solverInternal.targetCenterArmPos - b;
				}
				FullBodyIK.Matrix3x3 matrix3x4;
				if (eyesRate > 1E-07f && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x4, ref vector2, ref vector4))
				{
					FullBodyIK.Matrix3x3 matrix3x5;
					FullBodyIK.SAFBIKMatMult(out matrix3x5, ref matrix3x4, ref this._centerLegToArmBasisInv);
					FullBodyIK.Matrix3x3 matrix3x6 = matrix3x4;
					FullBodyIK.SAFBIKMatMultRet0(ref matrix3x4, ref this._centerLegToArmBoneToBaseBasis);
					Vector3 b2;
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out b2, ref matrix3x5, ref this._defaultCenterEyePos, ref this._defaultCenterLegPos, ref a3);
					Vector3 vector7 = this._eyesEffector.worldPosition - b2;
					float sin = this._internalValues.bodyIK.upperEyesLimitYaw.sin;
					float sin2 = this._internalValues.bodyIK.upperEyesLimitPitchUp.sin;
					float sin3 = this._internalValues.bodyIK.upperEyesLimitPitchDown.sin;
					FullBodyIK.SAFBIKMatMultVecInv(out vector7, ref matrix3x4, ref vector7);
					vector7.x *= this._settings.bodyIK.upperEyesYawRate;
					if (vector7.y >= 0f)
					{
						vector7.y *= this._settings.bodyIK.upperEyesPitchUpRate;
					}
					else
					{
						vector7.y *= this._settings.bodyIK.upperEyesPitchDownRate;
					}
					FullBodyIK.SAFBIKVecNormalize(ref vector7);
					if (FullBodyIK._ComputeEyesRange(ref vector7, this._internalValues.bodyIK.upperEyesTraceTheta.cos))
					{
						FullBodyIK._LimitXY(ref vector7, sin, sin, sin3, sin2);
					}
					FullBodyIK.SAFBIKMatMultVec(out vector7, ref matrix3x4, ref vector7);
					Vector3 column = matrix3x4.column0;
					Vector3 column2 = matrix3x4.column1;
					Vector3 vector8 = vector7;
					if (FullBodyIK.SAFBIKComputeBasisLockZ(out matrix3x4, ref column, ref column2, ref vector8))
					{
					}
					FullBodyIK.SAFBIKMatMultRet0(ref matrix3x4, ref this._centerLegToArmBaseToBoneBasis);
					float num6 = this._settings.bodyIK.upperEyesToCenterLegRate * eyesRate;
					float num7 = this._settings.bodyIK.upperEyesToSpineRate * eyesRate;
					if (num7 > 1E-07f)
					{
						FullBodyIK.Matrix3x3 matrix3x7;
						FullBodyIK.SAFBIKMatFastLerp(out matrix3x7, ref matrix3x6, ref matrix3x4, num7);
						vector2 = matrix3x7.column0;
						vector4 = matrix3x7.column1;
					}
					if (num6 > 1E-07f && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x6, ref vector, ref vector3))
					{
						FullBodyIK.Matrix3x3 matrix3x7;
						FullBodyIK.SAFBIKMatFastLerp(out matrix3x7, ref matrix3x6, ref matrix3x4, num6);
						vector = matrix3x7.column0;
						vector3 = matrix3x7.column1;
					}
				}
				if (continuousSolverEnabled)
				{
					solverInternal.Restore();
					solverInternal.UpperSolve();
				}
				int num8 = (this._spineBones == null) ? 0 : this._spineBones.Length;
				float upperContinuousCenterLegRotationStableRate = this._settings.bodyIK.upperContinuousCenterLegRotationStableRate;
				FullBodyIK.Matrix3x3 matrix3x8;
				if (this._settings.bodyIK.upperSolveHipsEnabled && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x8, ref vector, ref vector3))
				{
					FullBodyIK.Matrix3x3 identity = FullBodyIK.Matrix3x3.identity;
					if (this._internalValues.animatorEnabled || this._internalValues.resetTransforms)
					{
						if (continuousSolverEnabled && upperContinuousCenterLegRotationStableRate > 1E-07f)
						{
							FullBodyIK.Matrix3x3 identity2 = FullBodyIK.Matrix3x3.identity;
							Vector3 vector9 = a - centerLegPos;
							Vector3 vector10 = vector;
							if (FullBodyIK.SAFBIKVecNormalize(ref vector9) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out identity2, ref vector10, ref vector9))
							{
								FullBodyIK.Matrix3x3 matrix3x9;
								FullBodyIK.SAFBIKMatFastLerp(out matrix3x9, ref matrix3x8, ref identity2, upperContinuousCenterLegRotationStableRate);
								matrix3x8 = matrix3x9;
							}
						}
						Vector3 vector11 = solverInternal.nearArmPos[1] - solverInternal.nearArmPos[0];
						Vector3 vector12 = (solverInternal.nearArmPos[1] + solverInternal.nearArmPos[0]) * 0.5f - solverInternal.centerLegPos;
						FullBodyIK.Matrix3x3 matrix3x10;
						if (FullBodyIK.SAFBIKVecNormalize(ref vector12) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x10, ref vector11, ref vector12))
						{
							FullBodyIK.SAFBIKMatMultInv1(out identity, ref matrix3x8, ref matrix3x10);
						}
					}
					else
					{
						FullBodyIK.SAFBIKMatMultRet0(ref matrix3x8, ref this._centerLegToArmBasisInv);
						if (continuousSolverEnabled && upperContinuousCenterLegRotationStableRate > 1E-07f)
						{
							FullBodyIK.Matrix3x3 identity3 = FullBodyIK.Matrix3x3.identity;
							Vector3 vector13 = a - centerLegPos;
							Vector3 vector14 = vector;
							if (FullBodyIK.SAFBIKVecNormalize(ref vector13) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out identity3, ref vector14, ref vector13))
							{
								FullBodyIK.SAFBIKMatMultRet0(ref identity3, ref this._centerLegToArmBasisInv);
								FullBodyIK.Matrix3x3 matrix3x11;
								FullBodyIK.SAFBIKMatFastLerp(out matrix3x11, ref matrix3x8, ref identity3, upperContinuousCenterLegRotationStableRate);
								matrix3x8 = matrix3x11;
							}
						}
						FullBodyIK.Matrix3x3 centerLegBasis = solverInternal.centerLegBasis;
						FullBodyIK.SAFBIKMatMultInv1(out identity, ref matrix3x8, ref centerLegBasis);
					}
					if (this._settings.bodyIK.upperCenterLegLerpRate < 0.9999999f)
					{
						FullBodyIK.SAFBIKMatFastLerpToIdentity(ref identity, 1f - this._settings.bodyIK.upperCenterLegLerpRate);
					}
					solverInternal.UpperRotation(-1, ref identity);
				}
				float defaultCenterLegToCeterArmLen = this._defaultCenterLegToCeterArmLen;
				Vector3 column3 = solverInternal.centerLegBasis.column0;
				Vector3 a4 = vector4 * defaultCenterLegToCeterArmLen + solverInternal.centerLegPos;
				float upperSpineLerpRate = this._settings.bodyIK.upperSpineLerpRate;
				for (int num9 = 0; num9 != num8; num9++)
				{
					if (this._spineEnabled[num9])
					{
						Vector3 b3 = solverInternal.spinePos[num9];
						if (num9 + 1 == num8)
						{
							Vector3 vector15 = solverInternal.nearArmPos[1] - solverInternal.nearArmPos[0];
							Vector3 vector16 = solverInternal.centerArmPos - b3;
							Vector3 vector17 = vector2;
							Vector3 vector18 = a4 - b3;
							if (FullBodyIK.SAFBIKVecNormalize2(ref vector16, ref vector18))
							{
								FullBodyIK.Matrix3x3 matrix3x12;
								FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x12, ref vector17, ref vector18);
								FullBodyIK.Matrix3x3 matrix3x13;
								FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x13, ref vector15, ref vector16);
								FullBodyIK.Matrix3x3 matrix3x14;
								FullBodyIK.SAFBIKMatMultInv1(out matrix3x14, ref matrix3x12, ref matrix3x13);
								if (upperSpineLerpRate < 0.9999999f)
								{
									FullBodyIK.SAFBIKMatFastLerpToIdentity(ref matrix3x14, 1f - upperSpineLerpRate);
								}
								solverInternal.UpperRotation(num9, ref matrix3x14);
							}
						}
						else
						{
							Vector3 a5 = (num9 + 1 != num8) ? solverInternal.spinePos[num9 + 1] : solverInternal.neckPos;
							Vector3 b4 = (num9 == 0) ? solverInternal.centerLegPos : solverInternal.spinePos[num9 - 1];
							Vector3 b5 = solverInternal.nearArmPos[1] - solverInternal.nearArmPos[0];
							Vector3 vector19 = a5 - b3;
							Vector3 b6 = vector2;
							Vector3 a6 = a4 - b4;
							Vector3 b7 = a4 - b3;
							if (FullBodyIK.SAFBIKVecNormalize4(ref b5, ref vector19, ref a6, ref b7))
							{
								FullBodyIK.Matrix3x3 matrix3x15;
								FullBodyIK.Matrix3x3 matrix3x16;
								if (FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x15, ref b5, ref a6) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x16, ref b5, ref b7))
								{
									FullBodyIK.SAFBIKMatMultCol1(out a6, ref matrix3x15, ref this._spinePrevCenterArmToChildBasis[num9]);
									FullBodyIK.SAFBIKMatMultCol1(out b7, ref matrix3x16, ref this._spineCenterArmToChildBasis[num9]);
									float t3 = this._spineDirXRate[num9];
									b5 = Vector3.Lerp(column3, b5, t3);
									b6 = Vector3.Lerp(column3, b6, t3);
									if (num9 + 1 != num8)
									{
										a6 = Vector3.Lerp(a6, b7, this._settings.bodyIK.spineDirYLerpRate);
										if (!FullBodyIK.SAFBIKVecNormalize(ref a6))
										{
											a6 = vector19;
										}
									}
									FullBodyIK.Matrix3x3 matrix3x17;
									FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x17, ref b6, ref a6);
									FullBodyIK.Matrix3x3 matrix3x18;
									FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x18, ref b5, ref vector19);
									FullBodyIK.Matrix3x3 matrix3x19;
									FullBodyIK.SAFBIKMatMultInv1(out matrix3x19, ref matrix3x17, ref matrix3x18);
									if (upperSpineLerpRate < 0.9999999f)
									{
										FullBodyIK.SAFBIKMatFastLerpToIdentity(ref matrix3x19, 1f - upperSpineLerpRate);
									}
									solverInternal.UpperRotation(num9, ref matrix3x19);
								}
							}
						}
					}
				}
				this._UpperSolve_Translate2(ref this._internalValues.bodyIK.upperPostTranslateRate, ref this._internalValues.bodyIK.upperContinuousPostTranslateStableRate, ref zero);
				return true;
			}

			// Token: 0x060007C2 RID: 1986 RVA: 0x00045420 File Offset: 0x00043620
			private void _ShoulderResolve()
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				solverInternal.ShoulderResolve();
			}

			// Token: 0x060007C3 RID: 1987 RVA: 0x0004543C File Offset: 0x0004363C
			private void _UpperSolve_PresolveBaseCenterLegTransform(out Vector3 centerLegPos, out FullBodyIK.Matrix3x3 centerLegBasis)
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				FullBodyIK.BodyIK.SolverCaches solverCaches = this._solverCaches;
				this._GetBaseCenterLegTransform(out centerLegPos, out centerLegBasis);
				if (this._legBones == null || !this._legBones[0].transformIsAlive || !this._legBones[1].transformIsAlive)
				{
					return;
				}
				if (solverCaches.limbLegPull[0] <= 1E-07f && solverCaches.limbLegPull[1] <= 1E-07f)
				{
					return;
				}
				Vector3 a;
				FullBodyIK.SAFBIKMatMultVecPreSubAdd(out a, ref centerLegBasis, ref this._legBones[0]._defaultPosition, ref this._defaultCenterLegPos, ref centerLegPos);
				Vector3 a2;
				FullBodyIK.SAFBIKMatMultVecPreSubAdd(out a2, ref centerLegBasis, ref this._legBones[1]._defaultPosition, ref this._defaultCenterLegPos, ref centerLegPos);
				bool flag = false;
				flag |= solverInternal.legs.SolveTargetBeginPos(0, ref a);
				flag |= solverInternal.legs.SolveTargetBeginPos(1, ref a2);
				if (flag)
				{
					Vector3 b = centerLegBasis.column0 * this._defaultCenterLegHalfLen;
					centerLegPos = Vector3.Lerp(a + b, a2 - b, solverCaches.limbLegRate);
				}
			}

			// Token: 0x060007C4 RID: 1988 RVA: 0x00045550 File Offset: 0x00043750
			private void _UpperSolve_Transform(int origIndex, ref FullBodyIK.Matrix3x3 transformBasis)
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				Vector3 vector = (origIndex != -1) ? solverInternal.spinePos[origIndex] : solverInternal.centerLegPos;
				for (int num = 0; num != 2; num++)
				{
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.armPos[num], ref transformBasis, ref solverInternal.armPos[num], ref vector, ref vector);
					if (this._shoulderBones != null)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.shoulderPos[num], ref transformBasis, ref solverInternal.shoulderPos[num], ref vector, ref vector);
					}
				}
				int num2 = (this._spineBones == null) ? 0 : this._spineBones.Length;
				for (int i = origIndex + 1; i < num2; i++)
				{
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.spinePos[i], ref transformBasis, ref solverInternal.spinePos[i], ref vector, ref vector);
				}
				if (this._neckBone != null)
				{
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.neckPos, ref transformBasis, ref solverInternal.neckPos, ref vector, ref vector);
				}
				if (origIndex == -1 && solverInternal.legPos != null)
				{
					for (int j = 0; j < 2; j++)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.legPos[j], ref transformBasis, ref solverInternal.legPos[j], ref vector, ref vector);
					}
				}
				solverInternal.SetDirtyVariables();
			}

			// Token: 0x060007C5 RID: 1989 RVA: 0x000456B4 File Offset: 0x000438B4
			private bool _UpperSolve_PreTranslate2(out Vector3 translate, ref FullBodyIK.CachedRate01 translateRate, ref FullBodyIK.CachedRate01 stableRate, ref Vector3 stableCenterLegPos)
			{
				translate = Vector3.zero;
				if (this._hipsEffector.positionEnabled && this._hipsEffector.positionWeight <= 1E-07f && this._hipsEffector.pull >= 0.9999999f)
				{
					return false;
				}
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				bool continuousSolverEnabled = this._internalValues.continuousSolverEnabled;
				bool flag = continuousSolverEnabled && stableRate.isGreater0;
				if (solverInternal.targetCenterArmEnabled)
				{
					translate = solverInternal.targetCenterArmPos - solverInternal.currentCenterArmPos;
					flag = true;
				}
				if (flag)
				{
					if (translateRate.isLess1)
					{
						translate *= translateRate.value;
					}
					if (continuousSolverEnabled && stableRate.isGreater0)
					{
						Vector3 b = stableCenterLegPos - solverInternal.centerLegPos;
						translate = Vector3.Lerp(translate, b, stableRate.value);
					}
					if (this._hipsEffector.positionEnabled && this._hipsEffector.pull > 1E-07f)
					{
						Vector3 b2 = this._hipsEffector._hidden_worldPosition - solverInternal.centerLegPos;
						translate = Vector3.Lerp(translate, b2, this._hipsEffector.pull);
					}
					return true;
				}
				return false;
			}

			// Token: 0x060007C6 RID: 1990 RVA: 0x00045814 File Offset: 0x00043A14
			private void _UpperSolve_Translate2(ref FullBodyIK.CachedRate01 translateRate, ref FullBodyIK.CachedRate01 stableRate, ref Vector3 stableCenterLegPos)
			{
				Vector3 vector;
				if (this._UpperSolve_PreTranslate2(out vector, ref translateRate, ref stableRate, ref stableCenterLegPos))
				{
					FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
					solverInternal.Translate(ref vector);
				}
			}

			// Token: 0x060007C7 RID: 1991 RVA: 0x00045840 File Offset: 0x00043A40
			private void _LowerSolve(bool firstPass)
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				FullBodyIK.BodyIK.SolverCaches solverCaches = this._solverCaches;
				if (solverInternal.spinePos == null || solverInternal.spinePos.Length == 0)
				{
					return;
				}
				float num = (!firstPass) ? solverCaches.armToLegRate : 1f;
				if (solverInternal.PrepareLowerRotation(0))
				{
					Vector3 column = solverInternal.centerLegBasis.column1;
					for (int i = 0; i < 2; i++)
					{
						if (solverInternal.legs.endPosEnabled[i] && solverInternal.legs.targetBeginPosEnabled[i])
						{
							Vector3 a = solverInternal.legs.targetBeginPos[i] - solverInternal.legs.beginPos[i];
							if (FullBodyIK.SAFBIKVecNormalize(ref a))
							{
								float num2 = Vector3.Dot(column, -a);
								num2 = Mathf.Clamp01(num2);
								num2 = 1f - num2;
								solverInternal.SetSolveFeedbackRate(i, num2 * num);
							}
						}
					}
					Quaternion quaternion;
					if (solverInternal.SolveLowerRotation(0, out quaternion))
					{
						solverInternal.LowerRotation(0, ref quaternion, false);
					}
				}
				if (!this._hipsEffector.positionEnabled || this._hipsEffector.positionWeight > 1E-07f || this._hipsEffector.pull < 0.9999999f)
				{
					Vector3 a2;
					if (solverInternal.PrepareLowerTranslate() && solverInternal.SolveLowerTranslate(out a2))
					{
						if (num < 0.9999999f)
						{
							a2 *= num;
						}
						if (this._hipsEffector.positionEnabled && this._hipsEffector.pull > 1E-07f)
						{
							Vector3 b = this._hipsEffector._hidden_worldPosition - solverInternal.centerLegPos;
							a2 = Vector3.Lerp(a2, b, this._hipsEffector.pull);
						}
						solverInternal.Translate(ref a2);
					}
				}
			}

			// Token: 0x060007C8 RID: 1992 RVA: 0x00045A34 File Offset: 0x00043C34
			private void _ComputeWorldTransform()
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				if (solverInternal == null || solverInternal.spinePos == null || solverInternal.spinePos.Length == 0)
				{
					return;
				}
				if (this._hipsBone != null && this._hipsBone.transformIsAlive && solverInternal.spinePos != null && solverInternal.spinePos.Length > 0 && this._neckBone != null && this._neckBone.transformIsAlive)
				{
					Vector3 vector = new Vector3(1f, 0f, 0f);
					Vector3 vector2 = solverInternal.legs.beginPos[1] - solverInternal.legs.beginPos[0];
					Vector3 vector3 = solverInternal.spinePos[0] - (solverInternal.legs.beginPos[1] + solverInternal.legs.beginPos[0]) * 0.5f;
					FullBodyIK.Matrix3x3 matrix3x = default(FullBodyIK.Matrix3x3);
					if (FullBodyIK.SAFBIKVecNormalize(ref vector3) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x, ref vector2, ref vector3))
					{
						FullBodyIK.Matrix3x3 matrix3x2;
						FullBodyIK.SAFBIKMatMult(out matrix3x2, ref matrix3x, ref this._centerLegBoneBasisInv);
						vector = matrix3x.column0;
						Quaternion worldRotation;
						FullBodyIK.SAFBIKMatMultGetRot(out worldRotation, ref matrix3x2, ref this._hipsBone._defaultBasis);
						this._hipsBone.worldRotation = worldRotation;
						if (this._hipsBone.isWritebackWorldPosition)
						{
							Vector3 vector4 = -this._spineBone._defaultLocalTranslate;
							Vector3 worldPosition;
							FullBodyIK.SAFBIKMatMultVecAdd(out worldPosition, ref matrix3x2, ref vector4, ref solverInternal.spinePos[0]);
							this._hipsBone.worldPosition = worldPosition;
						}
					}
					else if (FullBodyIK.SAFBIKVecNormalize(ref vector2))
					{
						vector = vector2;
					}
					int num = solverInternal.spinePos.Length;
					for (int num2 = 0; num2 != num; num2++)
					{
						if (this._spineEnabled[num2])
						{
							if (num2 + 1 == num)
							{
								vector3 = solverInternal.neckPos - solverInternal.spinePos[num2];
								if (solverInternal.nearArmPos != null)
								{
									vector2 = solverInternal.nearArmPos[1] - solverInternal.nearArmPos[0];
								}
								else
								{
									vector2 = vector;
								}
							}
							else
							{
								vector3 = solverInternal.spinePos[num2 + 1] - solverInternal.spinePos[num2];
								vector2 = vector;
								if (solverInternal.nearArmPos != null)
								{
									Vector3 b = solverInternal.nearArmPos[1] - solverInternal.nearArmPos[0];
									if (FullBodyIK.SAFBIKVecNormalize(ref b))
									{
										vector2 = Vector3.Lerp(vector2, b, this._settings.bodyIK.spineDirXLegToArmRate);
									}
								}
							}
							if (FullBodyIK.SAFBIKVecNormalize(ref vector3) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x, ref vector2, ref vector3))
							{
								vector = matrix3x.column0;
								Quaternion worldRotation2;
								FullBodyIK.SAFBIKMatMultGetRot(out worldRotation2, ref matrix3x, ref this._spineBones[num2]._boneToWorldBasis);
								this._spineBones[num2].worldRotation = worldRotation2;
								if (this._spineBones[num2].isWritebackWorldPosition)
								{
									this._spineBones[num2].worldPosition = solverInternal.spinePos[num2];
								}
							}
						}
					}
					if (this._shoulderBones != null)
					{
						for (int num3 = 0; num3 != 2; num3++)
						{
							Vector3 vector5 = solverInternal.armPos[num3] - solverInternal.shoulderPos[num3];
							Vector3 rhs;
							if (this._internalValues.shoulderDirYAsNeck != 0)
							{
								rhs = solverInternal.neckPos - solverInternal.shoulderPos[num3];
							}
							else
							{
								rhs = solverInternal.shoulderPos[num3] - solverInternal.spineUPos;
							}
							vector5 = ((num3 != 0) ? vector5 : (-vector5));
							Vector3 lhs = Vector3.Cross(vector5, rhs);
							rhs = Vector3.Cross(lhs, vector5);
							if (FullBodyIK.SAFBIKVecNormalize3(ref vector5, ref rhs, ref lhs))
							{
								matrix3x.SetColumn(ref vector5, ref rhs, ref lhs);
								Quaternion worldRotation3;
								FullBodyIK.SAFBIKMatMultGetRot(out worldRotation3, ref matrix3x, ref this._shoulderBones[num3]._boneToWorldBasis);
								this._shoulderBones[num3].worldRotation = worldRotation3;
							}
						}
					}
				}
			}

			// Token: 0x060007C9 RID: 1993 RVA: 0x00045EB8 File Offset: 0x000440B8
			private bool _IsEffectorEnabled()
			{
				return (this._hipsEffector.positionEnabled && this._hipsEffector.pull > 1E-07f) || (this._hipsEffector.rotationEnabled && this._hipsEffector.rotationWeight > 1E-07f) || (this._neckEffector.positionEnabled && this._neckEffector.pull > 1E-07f) || (this._eyesEffector.positionEnabled && this._eyesEffector.positionWeight > 1E-07f && this._eyesEffector.pull > 1E-07f) || (this._armEffectors[0].positionEnabled && this._armEffectors[0].pull > 1E-07f) || (this._armEffectors[1].positionEnabled && this._armEffectors[1].pull > 1E-07f) || ((this._elbowEffectors[0].positionEnabled && this._elbowEffectors[0].pull > 1E-07f) || (this._elbowEffectors[1].positionEnabled && this._elbowEffectors[1].pull > 1E-07f) || (this._kneeEffectors[0].positionEnabled && this._kneeEffectors[0].pull > 1E-07f) || (this._kneeEffectors[1].positionEnabled && this._kneeEffectors[1].pull > 1E-07f) || (this._wristEffectors[0].positionEnabled && this._wristEffectors[0].pull > 1E-07f) || (this._wristEffectors[1].positionEnabled && this._wristEffectors[1].pull > 1E-07f) || (this._footEffectors[0].positionEnabled && this._footEffectors[0].pull > 1E-07f) || (this._footEffectors[1].positionEnabled && this._footEffectors[1].pull > 1E-07f));
			}

			// Token: 0x060007CA RID: 1994 RVA: 0x00046110 File Offset: 0x00044310
			private bool _PrepareSolverInternal()
			{
				if (this._armBones == null || this._legBones == null)
				{
					this._solverInternal = null;
					return false;
				}
				if (this._neckEffector != null)
				{
					this._solverCaches.neckPull = ((!this._neckEffector.positionEnabled) ? 0f : this._neckEffector.pull);
				}
				if (this._headEffector != null)
				{
					this._solverCaches.headPull = ((!this._headEffector.positionEnabled) ? 0f : this._headEffector.pull);
				}
				if (this._eyesEffector != null)
				{
					this._solverCaches.eyesRate = ((!this._eyesEffector.positionEnabled) ? 0f : (this._eyesEffector.pull * this._eyesEffector.positionWeight));
				}
				for (int num = 0; num != 2; num++)
				{
					if (this._armEffectors[num] != null)
					{
						this._solverCaches.armPull[num] = ((!this._armEffectors[num].positionEnabled) ? 0f : this._armEffectors[num].pull);
					}
					if (this._elbowEffectors[num] != null)
					{
						this._solverCaches.elbowPull[num] = ((!this._elbowEffectors[num].positionEnabled) ? 0f : this._elbowEffectors[num].pull);
					}
					if (this._wristEffectors[num] != null)
					{
						this._solverCaches.wristPull[num] = ((!this._wristEffectors[num].positionEnabled) ? 0f : this._wristEffectors[num].pull);
					}
					if (this._kneeEffectors[num] != null)
					{
						this._solverCaches.kneePull[num] = ((!this._kneeEffectors[num].positionEnabled) ? 0f : this._kneeEffectors[num].pull);
					}
					if (this._footEffectors[num] != null)
					{
						this._solverCaches.footPull[num] = ((!this._footEffectors[num].positionEnabled) ? 0f : this._footEffectors[num].pull);
					}
				}
				this._solverCaches.neckHeadPull = FullBodyIK.BodyIK._ConcatPull(this._solverCaches.neckPull, this._solverCaches.headPull);
				float num2 = this._solverCaches.neckHeadPull;
				float num3 = 0f;
				for (int num4 = 0; num4 != 2; num4++)
				{
					float num5 = this._solverCaches.armPull[num4];
					if (num5 == 0f)
					{
						num5 = this._solverCaches.elbowPull[num4];
					}
					else
					{
						num5 = FullBodyIK.BodyIK._ConcatPull(num5, this._solverCaches.elbowPull[num4]);
					}
					if (num5 == 0f)
					{
						num5 = this._solverCaches.wristPull[num4];
					}
					else
					{
						num5 = FullBodyIK.BodyIK._ConcatPull(num5, this._solverCaches.wristPull[num4]);
					}
					float num6 = this._solverCaches.kneePull[num4];
					if (num6 == 0f)
					{
						num6 = this._solverCaches.wristPull[num4];
					}
					else
					{
						num6 = FullBodyIK.BodyIK._ConcatPull(num6, this._solverCaches.wristPull[num4]);
					}
					float num7 = this._solverCaches.kneePull[num4];
					if (num7 == 0f)
					{
						num7 = this._solverCaches.footPull[num4];
					}
					else
					{
						num7 = FullBodyIK.BodyIK._ConcatPull(num7, this._solverCaches.footPull[num4]);
					}
					this._solverCaches.fullArmPull[num4] = num5;
					this._solverCaches.limbLegPull[num4] = num7;
					this._solverCaches.armToElbowPull[num4] = FullBodyIK.BodyIK._GetBalancedPullLockFrom(this._solverCaches.armPull[num4], this._solverCaches.elbowPull[num4]);
					this._solverCaches.armToWristPull[num4] = FullBodyIK.BodyIK._GetBalancedPullLockFrom(this._solverCaches.armPull[num4], this._solverCaches.wristPull[num4]);
					this._solverCaches.neckHeadToFullArmPull[num4] = FullBodyIK.BodyIK._GetBalancedPullLockTo(this._solverCaches.neckHeadPull, num5);
					num2 += num5;
					num3 += num7;
				}
				this._solverCaches.limbArmRate = FullBodyIK.BodyIK._GetLerpRateFromPull2(this._solverCaches.fullArmPull[0], this._solverCaches.fullArmPull[1]);
				this._solverCaches.limbLegRate = FullBodyIK.BodyIK._GetLerpRateFromPull2(this._solverCaches.limbLegPull[0], this._solverCaches.limbLegPull[1]);
				this._solverCaches.armToLegRate = FullBodyIK.BodyIK._GetLerpRateFromPull2(num2, num3);
				if (this._spineBones != null)
				{
					int num8 = this._spineBones.Length;
					float num9 = Mathf.Clamp01(this._settings.bodyIK.spineDirXLegToArmRate);
					float num10 = Mathf.Max(this._settings.bodyIK.spineDirXLegToArmToRate, num9);
					for (int num11 = 0; num11 != num8; num11++)
					{
						if (num11 == 0)
						{
							this._spineDirXRate[num11] = num9;
						}
						else if (num11 + 1 == num8)
						{
							this._spineDirXRate[num11] = num10;
						}
						else
						{
							this._spineDirXRate[num11] = num9 + (num10 - num9) * ((float)num11 / (float)(num8 - 1));
						}
					}
					if (num8 > 0)
					{
						this._spineEnabled[0] = this._settings.bodyIK.upperSolveSpineEnabled;
					}
					if (num8 > 1)
					{
						this._spineEnabled[1] = this._settings.bodyIK.upperSolveSpine2Enabled;
					}
					if (num8 > 2)
					{
						this._spineEnabled[2] = this._settings.bodyIK.upperSolveSpine3Enabled;
					}
					if (num8 > 3)
					{
						this._spineEnabled[3] = this._settings.bodyIK.upperSolveSpine4Enabled;
					}
				}
				if (this._solverInternal == null)
				{
					this._solverInternal = new FullBodyIK.BodyIK.SolverInternal();
					this._solverInternal.settings = this._settings;
					this._solverInternal.internalValues = this._internalValues;
					this._solverInternal._solverCaches = this._solverCaches;
					this._solverInternal.arms._bendingPull = this._solverCaches.armToElbowPull;
					this._solverInternal.arms._endPull = this._solverCaches.armToWristPull;
					this._solverInternal.arms._beginToBendingLength = this._elbowEffectorMaxLength;
					this._solverInternal.arms._beginToEndLength = this._wristEffectorMaxLength;
					this._solverInternal.legs._bendingPull = this._solverCaches.kneePull;
					this._solverInternal.legs._endPull = this._solverCaches.footPull;
					this._solverInternal.legs._beginToBendingLength = this._kneeEffectorMaxLength;
					this._solverInternal.legs._beginToEndLength = this._footEffectorMaxLength;
					this._solverInternal._shouderLocalAxisYInv = this._shouderLocalAxisYInv;
					this._solverInternal._armEffectors = this._armEffectors;
					this._solverInternal._wristEffectors = this._wristEffectors;
					this._solverInternal._neckEffector = this._neckEffector;
					this._solverInternal._headEffector = this._headEffector;
					this._solverInternal._spineBones = this._spineBones;
					this._solverInternal._shoulderBones = this._shoulderBones;
					this._solverInternal._armBones = this._armBones;
					this._solverInternal._limbIK = this._limbIK;
					this._solverInternal._centerLegBoneBasisInv = this._centerLegBoneBasisInv;
					FullBodyIK.PrepareArray<Vector3, FullBodyIK.Bone>(ref this._solverInternal.shoulderPos, this._shoulderBones);
					FullBodyIK.PrepareArray<Vector3, FullBodyIK.Bone>(ref this._solverInternal.spinePos, this._spineBones);
					this._solverInternal.nearArmPos = ((this._shoulderBones == null) ? this._solverInternal.armPos : this._solverInternal.shoulderPos);
					if (this._spineUBone != null && (this._shoulderBones != null || this._armBones != null))
					{
						FullBodyIK.Bone[] array = (this._shoulderBones == null) ? this._armBones : this._shoulderBones;
						Vector3 vector = array[1]._defaultPosition + array[0]._defaultPosition;
						Vector3 lhs = array[1]._defaultPosition - array[0]._defaultPosition;
						vector = vector * 0.5f - this._spineUBone._defaultPosition;
						Vector3 rhs = Vector3.Cross(lhs, vector);
						lhs = Vector3.Cross(vector, rhs);
						if (FullBodyIK.SAFBIKVecNormalize3(ref lhs, ref vector, ref rhs))
						{
							FullBodyIK.Matrix3x3 matrix3x = FullBodyIK.Matrix3x3.FromColumn(ref lhs, ref vector, ref rhs);
							this._solverInternal._spineUBoneLocalAxisBasisInv = matrix3x.transpose;
						}
					}
				}
				this._solverInternal.headEnabled = (this._headBone != null && this._solverCaches.headPull > 1E-07f);
				return true;
			}

			// Token: 0x060007CB RID: 1995 RVA: 0x000469EC File Offset: 0x00044BEC
			private void _PresolveHips()
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				if (this._hipsEffector == null)
				{
					return;
				}
				bool flag = this._hipsEffector.rotationEnabled && this._hipsEffector.rotationWeight > 1E-07f;
				bool flag2 = this._hipsEffector.positionEnabled && this._hipsEffector.pull > 1E-07f;
				if (!flag && !flag2)
				{
					return;
				}
				FullBodyIK.Matrix3x3 centerLegBasis = solverInternal.centerLegBasis;
				if (flag)
				{
					Quaternion lhs = this._hipsEffector.worldRotation * FullBodyIK.Inverse(this._hipsEffector._defaultRotation);
					Quaternion q;
					FullBodyIK.SAFBIKMatGetRot(out q, ref centerLegBasis);
					Quaternion b = lhs * FullBodyIK.Inverse(q);
					if (this._hipsEffector.rotationWeight < 0.9999999f)
					{
						b = Quaternion.Lerp(Quaternion.identity, b, this._hipsEffector.rotationWeight);
					}
					solverInternal.LowerRotation(-1, ref b, true);
					centerLegBasis = solverInternal.centerLegBasis;
				}
				if (flag2)
				{
					Vector3 hidden_worldPosition = this._hipsEffector._hidden_worldPosition;
					Vector3 a;
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out a, ref centerLegBasis, ref this._defaultCenterLegPos, ref this._hipsEffector._defaultPosition, ref hidden_worldPosition);
					Vector3 a2 = a - solverInternal.centerLegPos;
					if (this._hipsEffector.pull < 0.9999999f)
					{
						a2 *= this._hipsEffector.pull;
					}
					solverInternal.Translate(ref a2);
				}
			}

			// Token: 0x060007CC RID: 1996 RVA: 0x00046B5C File Offset: 0x00044D5C
			private void _ResetTransforms()
			{
				FullBodyIK.Matrix3x3 identity = FullBodyIK.Matrix3x3.identity;
				Vector3 zero = Vector3.zero;
				this._GetBaseCenterLegTransform(out zero, out identity);
				this._ResetCenterLegTransform(ref zero, ref identity);
			}

			// Token: 0x060007CD RID: 1997 RVA: 0x00046B8C File Offset: 0x00044D8C
			private void _GetBaseCenterLegTransform(out Vector3 centerLegPos, out FullBodyIK.Matrix3x3 centerLegBasis)
			{
				centerLegBasis = this._internalValues.baseHipsBasis;
				if (this._hipsEffector != null)
				{
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out centerLegPos, ref this._internalValues.baseHipsBasis, ref this._defaultCenterLegPos, ref this._hipsEffector._defaultPosition, ref this._internalValues.baseHipsPos);
				}
				else
				{
					centerLegPos = default(Vector3);
				}
			}

			// Token: 0x060007CE RID: 1998 RVA: 0x00046BF0 File Offset: 0x00044DF0
			private void _ResetCenterLegTransform(ref Vector3 centerLegPos, ref FullBodyIK.Matrix3x3 centerLegBasis)
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				Vector3 defaultCenterLegPos = this._defaultCenterLegPos;
				if (this._legBones != null)
				{
					for (int num = 0; num != 2; num++)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.legPos[num], ref centerLegBasis, ref this._legBones[num]._defaultPosition, ref defaultCenterLegPos, ref centerLegPos);
					}
				}
				if (this._spineBones != null)
				{
					for (int num2 = 0; num2 != this._spineBones.Length; num2++)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.spinePos[num2], ref centerLegBasis, ref this._spineBones[num2]._defaultPosition, ref defaultCenterLegPos, ref centerLegPos);
					}
				}
				if (this._shoulderBones != null)
				{
					for (int num3 = 0; num3 != 2; num3++)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.shoulderPos[num3], ref centerLegBasis, ref this._shoulderBones[num3]._defaultPosition, ref defaultCenterLegPos, ref centerLegPos);
					}
				}
				if (this._armBones != null)
				{
					for (int num4 = 0; num4 != 2; num4++)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.armPos[num4], ref centerLegBasis, ref this._armBones[num4]._defaultPosition, ref defaultCenterLegPos, ref centerLegPos);
					}
				}
				if (this._neckBone != null)
				{
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.neckPos, ref centerLegBasis, ref this._neckBone._defaultPosition, ref defaultCenterLegPos, ref centerLegPos);
				}
				if (this._headBone != null && solverInternal.headEnabled)
				{
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.headPos, ref centerLegBasis, ref this._headBone._defaultPosition, ref defaultCenterLegPos, ref centerLegPos);
				}
				solverInternal.SetDirtyVariables();
				solverInternal._SetCenterLegPos(ref centerLegPos);
			}

			// Token: 0x060007CF RID: 1999 RVA: 0x00046D7C File Offset: 0x00044F7C
			private void _ResetShoulderTransform()
			{
				FullBodyIK.BodyIK.SolverInternal solverInternal = this._solverInternal;
				if (this._armBones == null || this._shoulderBones == null)
				{
					return;
				}
				if (this._spineUBone == null || !this._spineUBone.transformIsAlive || this._neckBone == null || !this._neckBone.transformIsAlive)
				{
				}
				if (!this._limbIK[2].IsSolverEnabled() && !this._limbIK[3].IsSolverEnabled())
				{
					return;
				}
				Vector3 vector = solverInternal.neckPos - solverInternal.spineUPos;
				Vector3 vector2 = solverInternal.nearArmPos[1] - solverInternal.nearArmPos[0];
				FullBodyIK.Matrix3x3 matrix3x;
				if (FullBodyIK.SAFBIKVecNormalize(ref vector) && FullBodyIK.SAFBIKComputeBasisFromXYLockY(out matrix3x, ref vector2, ref vector))
				{
					FullBodyIK.Matrix3x3 matrix3x2;
					FullBodyIK.SAFBIKMatMult(out matrix3x2, ref matrix3x, ref this._spineUBone._localAxisBasisInv);
					Vector3 spineUPos = solverInternal.spineUPos;
					for (int num = 0; num != 2; num++)
					{
						int num2 = (num != 0) ? 3 : 2;
						if (this._limbIK[num2].IsSolverEnabled())
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out solverInternal.armPos[num], ref matrix3x2, ref this._armBones[num]._defaultPosition, ref this._spineUBone._defaultPosition, ref spineUPos);
						}
					}
				}
			}

			// Token: 0x060007D0 RID: 2000 RVA: 0x00046EDC File Offset: 0x000450DC
			private static bool _ComputeCenterLegBasis(out FullBodyIK.Matrix3x3 centerLegBasis, ref Vector3 spinePos, ref Vector3 leftLegPos, ref Vector3 rightLegPos)
			{
				Vector3 vector = rightLegPos - leftLegPos;
				Vector3 vector2 = spinePos - (rightLegPos + leftLegPos) * 0.5f;
				if (FullBodyIK.SAFBIKVecNormalize(ref vector2))
				{
					return FullBodyIK.SAFBIKComputeBasisFromXYLockY(out centerLegBasis, ref vector, ref vector2);
				}
				centerLegBasis = FullBodyIK.Matrix3x3.identity;
				return false;
			}

			// Token: 0x060007D1 RID: 2001 RVA: 0x00046F48 File Offset: 0x00045148
			private static bool _KeepMaxLength(ref Vector3 posTo, ref Vector3 posFrom, float keepLength)
			{
				Vector3 vector = posTo - posFrom;
				float num = FullBodyIK.SAFBIKVecLength(ref vector);
				if (num > 1E-07f && num > keepLength)
				{
					vector *= keepLength / num;
					posTo = posFrom + vector;
					return true;
				}
				return false;
			}

			// Token: 0x060007D2 RID: 2002 RVA: 0x00046FA0 File Offset: 0x000451A0
			private static bool _KeepMaxLength(ref Vector3 posTo, ref Vector3 posFrom, ref FullBodyIK.FastLength keepLength)
			{
				Vector3 vector = posTo - posFrom;
				float num = FullBodyIK.SAFBIKVecLength(ref vector);
				if (num > 1E-07f && num > keepLength.length)
				{
					vector *= keepLength.length / num;
					posTo = posFrom + vector;
					return true;
				}
				return false;
			}

			// Token: 0x060007D3 RID: 2003 RVA: 0x00047004 File Offset: 0x00045204
			private static bool _KeepLength(ref Vector3 posTo, ref Vector3 posFrom, float keepLength)
			{
				Vector3 vector = posTo - posFrom;
				float num = FullBodyIK.SAFBIKVecLength(ref vector);
				if (num > 1E-07f)
				{
					vector *= keepLength / num;
					posTo = posFrom + vector;
					return true;
				}
				return false;
			}

			// Token: 0x060007D4 RID: 2004 RVA: 0x00047058 File Offset: 0x00045258
			private static Quaternion _GetRotation(ref Vector3 axisDir, float theta, float rate)
			{
				if ((theta >= -1E-07f && theta <= 1E-07f) || (rate >= -1E-07f && rate <= 1E-07f))
				{
					return Quaternion.identity;
				}
				return Quaternion.AngleAxis(FullBodyIK.SAFBIKAcos(theta) * rate * 57.29578f, axisDir);
			}

			// Token: 0x060007D5 RID: 2005 RVA: 0x000470B0 File Offset: 0x000452B0
			private static float _ConcatPull(float pull, float effectorPull)
			{
				if (pull >= 0.9999999f)
				{
					return 1f;
				}
				if (pull <= 1E-07f)
				{
					return effectorPull;
				}
				if (effectorPull <= 1E-07f)
				{
					return pull;
				}
				if (effectorPull >= 0.9999999f)
				{
					return 1f;
				}
				return pull + (1f - pull) * effectorPull;
			}

			// Token: 0x060007D6 RID: 2006 RVA: 0x00047104 File Offset: 0x00045304
			private static float _GetBalancedPullLockTo(float pullFrom, float pullTo)
			{
				if (pullTo <= 1E-07f)
				{
					return 1f - pullFrom;
				}
				if (pullFrom <= 1E-07f)
				{
					return 1f;
				}
				return pullTo / (pullFrom + pullTo);
			}

			// Token: 0x060007D7 RID: 2007 RVA: 0x0004712F File Offset: 0x0004532F
			private static float _GetBalancedPullLockFrom(float pullFrom, float pullTo)
			{
				if (pullFrom <= 1E-07f)
				{
					return pullTo;
				}
				if (pullTo <= 1E-07f)
				{
					return 0f;
				}
				return pullTo / (pullFrom + pullTo);
			}

			// Token: 0x060007D8 RID: 2008 RVA: 0x00047154 File Offset: 0x00045354
			private static float _GetLerpRateFromPull2(float pull0, float pull1)
			{
				if (pull0 > 1E-45f && pull1 > 1E-45f)
				{
					return Mathf.Clamp01(pull1 / (pull0 + pull1));
				}
				if (pull0 > 1E-45f)
				{
					return 0f;
				}
				if (pull1 > 1E-45f)
				{
					return 1f;
				}
				return 0.5f;
			}

			// Token: 0x04000C60 RID: 3168
			private FullBodyIK.LimbIK[] _limbIK;

			// Token: 0x04000C61 RID: 3169
			private FullBodyIK.Bone _hipsBone;

			// Token: 0x04000C62 RID: 3170
			private FullBodyIK.Bone[] _spineBones;

			// Token: 0x04000C63 RID: 3171
			private bool[] _spineEnabled;

			// Token: 0x04000C64 RID: 3172
			private FullBodyIK.Matrix3x3[] _spinePrevCenterArmToChildBasis;

			// Token: 0x04000C65 RID: 3173
			private FullBodyIK.Matrix3x3[] _spineCenterArmToChildBasis;

			// Token: 0x04000C66 RID: 3174
			private FullBodyIK.Bone _spineBone;

			// Token: 0x04000C67 RID: 3175
			private FullBodyIK.Bone _spineUBone;

			// Token: 0x04000C68 RID: 3176
			private FullBodyIK.Bone _neckBone;

			// Token: 0x04000C69 RID: 3177
			private FullBodyIK.Bone _headBone;

			// Token: 0x04000C6A RID: 3178
			private FullBodyIK.Bone[] _kneeBones;

			// Token: 0x04000C6B RID: 3179
			private FullBodyIK.Bone[] _elbowBones;

			// Token: 0x04000C6C RID: 3180
			private FullBodyIK.Bone[] _legBones;

			// Token: 0x04000C6D RID: 3181
			private FullBodyIK.Bone[] _shoulderBones;

			// Token: 0x04000C6E RID: 3182
			private FullBodyIK.Bone[] _armBones;

			// Token: 0x04000C6F RID: 3183
			private FullBodyIK.Bone[] _nearArmBones;

			// Token: 0x04000C70 RID: 3184
			private float[] _spineDirXRate;

			// Token: 0x04000C71 RID: 3185
			private FullBodyIK.Effector _hipsEffector;

			// Token: 0x04000C72 RID: 3186
			private FullBodyIK.Effector _neckEffector;

			// Token: 0x04000C73 RID: 3187
			private FullBodyIK.Effector _headEffector;

			// Token: 0x04000C74 RID: 3188
			private FullBodyIK.Effector _eyesEffector;

			// Token: 0x04000C75 RID: 3189
			private FullBodyIK.Effector[] _armEffectors = new FullBodyIK.Effector[2];

			// Token: 0x04000C76 RID: 3190
			private FullBodyIK.Effector[] _elbowEffectors = new FullBodyIK.Effector[2];

			// Token: 0x04000C77 RID: 3191
			private FullBodyIK.Effector[] _wristEffectors = new FullBodyIK.Effector[2];

			// Token: 0x04000C78 RID: 3192
			private FullBodyIK.Effector[] _kneeEffectors = new FullBodyIK.Effector[2];

			// Token: 0x04000C79 RID: 3193
			private FullBodyIK.Effector[] _footEffectors = new FullBodyIK.Effector[2];

			// Token: 0x04000C7A RID: 3194
			private Vector3 _defaultCenterLegPos = Vector3.zero;

			// Token: 0x04000C7B RID: 3195
			private FullBodyIK.Matrix3x3 _centerLegBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C7C RID: 3196
			private FullBodyIK.Matrix3x3 _centerLegBoneBasisInv = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C7D RID: 3197
			private FullBodyIK.Matrix3x3 _centerLegToArmBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C7E RID: 3198
			private FullBodyIK.Matrix3x3 _centerLegToArmBasisInv = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C7F RID: 3199
			private FullBodyIK.Matrix3x3 _centerLegToArmBoneToBaseBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C80 RID: 3200
			private FullBodyIK.Matrix3x3 _centerLegToArmBaseToBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000C81 RID: 3201
			private float[] _shoulderToArmLength = new float[2];

			// Token: 0x04000C82 RID: 3202
			private bool[] _shouderLocalAxisYInv = new bool[2];

			// Token: 0x04000C83 RID: 3203
			private FullBodyIK.FastLength[] _elbowEffectorMaxLength = new FullBodyIK.FastLength[2];

			// Token: 0x04000C84 RID: 3204
			private FullBodyIK.FastLength[] _wristEffectorMaxLength = new FullBodyIK.FastLength[2];

			// Token: 0x04000C85 RID: 3205
			private FullBodyIK.FastLength[] _kneeEffectorMaxLength = new FullBodyIK.FastLength[2];

			// Token: 0x04000C86 RID: 3206
			private FullBodyIK.FastLength[] _footEffectorMaxLength = new FullBodyIK.FastLength[2];

			// Token: 0x04000C87 RID: 3207
			private FullBodyIK.BodyIK.SolverCaches _solverCaches = new FullBodyIK.BodyIK.SolverCaches();

			// Token: 0x04000C88 RID: 3208
			private Vector3 _defaultCenterArmPos = Vector3.zero;

			// Token: 0x04000C89 RID: 3209
			private float _defaultCenterLegLen;

			// Token: 0x04000C8A RID: 3210
			private float _defaultCenterLegHalfLen;

			// Token: 0x04000C8B RID: 3211
			private float _defaultNearArmToNearArmLen;

			// Token: 0x04000C8C RID: 3212
			private float _defaultCenterLegToCeterArmLen;

			// Token: 0x04000C8D RID: 3213
			private Vector3 _defaultCenterEyePos = Vector3.zero;

			// Token: 0x04000C8E RID: 3214
			private FullBodyIK.BodyIK.SolverInternal _solverInternal;

			// Token: 0x04000C8F RID: 3215
			private FullBodyIK.Settings _settings;

			// Token: 0x04000C90 RID: 3216
			private FullBodyIK.InternalValues _internalValues;

			// Token: 0x04000C91 RID: 3217
			private bool _isSyncDisplacementAtLeastOnce;

			// Token: 0x0200018E RID: 398
			public class SolverCaches
			{
				// Token: 0x04000C92 RID: 3218
				public FullBodyIK.Bone[] armBones;

				// Token: 0x04000C93 RID: 3219
				public FullBodyIK.Bone[] shoulderBones;

				// Token: 0x04000C94 RID: 3220
				public FullBodyIK.Bone[] nearArmBones;

				// Token: 0x04000C95 RID: 3221
				public float armToArmLen;

				// Token: 0x04000C96 RID: 3222
				public float nearArmToNearArmLen;

				// Token: 0x04000C97 RID: 3223
				public float[] shoulderToArmLength;

				// Token: 0x04000C98 RID: 3224
				public float[] nearArmToNeckLength = new float[2];

				// Token: 0x04000C99 RID: 3225
				public float neckToHeadLength;

				// Token: 0x04000C9A RID: 3226
				public float neckPull;

				// Token: 0x04000C9B RID: 3227
				public float headPull;

				// Token: 0x04000C9C RID: 3228
				public float eyesRate;

				// Token: 0x04000C9D RID: 3229
				public float neckHeadPull;

				// Token: 0x04000C9E RID: 3230
				public float[] armPull = new float[2];

				// Token: 0x04000C9F RID: 3231
				public float[] elbowPull = new float[2];

				// Token: 0x04000CA0 RID: 3232
				public float[] wristPull = new float[2];

				// Token: 0x04000CA1 RID: 3233
				public float[] kneePull = new float[2];

				// Token: 0x04000CA2 RID: 3234
				public float[] footPull = new float[2];

				// Token: 0x04000CA3 RID: 3235
				public float[] fullArmPull = new float[2];

				// Token: 0x04000CA4 RID: 3236
				public float[] limbLegPull = new float[2];

				// Token: 0x04000CA5 RID: 3237
				public float[] armToElbowPull = new float[2];

				// Token: 0x04000CA6 RID: 3238
				public float[] armToWristPull = new float[2];

				// Token: 0x04000CA7 RID: 3239
				public float[] neckHeadToFullArmPull = new float[2];

				// Token: 0x04000CA8 RID: 3240
				public float limbArmRate;

				// Token: 0x04000CA9 RID: 3241
				public float limbLegRate;

				// Token: 0x04000CAA RID: 3242
				public float armToLegRate;

				// Token: 0x04000CAB RID: 3243
				public FullBodyIK.Matrix3x3 centerLegToNearArmBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000CAC RID: 3244
				public FullBodyIK.Matrix3x3 centerLegToNearArmBasisInv = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000CAD RID: 3245
				public FullBodyIK.Matrix3x3 centerLegToNaerArmBoneToBaseBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000CAE RID: 3246
				public FullBodyIK.Matrix3x3 centerLegToNaerArmBaseToBoneBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000CAF RID: 3247
				public Vector3 defaultCenterLegPos = Vector3.zero;
			}

			// Token: 0x0200018F RID: 399
			private class SolverInternal
			{
				// Token: 0x060007DA RID: 2010 RVA: 0x0004727C File Offset: 0x0004547C
				public SolverInternal()
				{
					this.arms.beginPos = this.armPos;
					this.legs.beginPos = this.legPos;
				}

				// Token: 0x1700010E RID: 270
				// (get) Token: 0x060007DB RID: 2011 RVA: 0x00047454 File Offset: 0x00045654
				public Vector3 centerArmPos
				{
					get
					{
						if (this._isDirtyCenterArmPos)
						{
							this._UpdateCenterArmPos();
						}
						return this._centerArmPos;
					}
				}

				// Token: 0x1700010F RID: 271
				// (get) Token: 0x060007DC RID: 2012 RVA: 0x0004746D File Offset: 0x0004566D
				public Vector3 centerLegPos
				{
					get
					{
						if (this._isDirtyCenterLegPos)
						{
							this._UpdateCenterLegPos();
						}
						return this._centerLegPos;
					}
				}

				// Token: 0x060007DD RID: 2013 RVA: 0x00047488 File Offset: 0x00045688
				public void _UpdateCenterArmPos()
				{
					if (this._isDirtyCenterArmPos)
					{
						this._isDirtyCenterArmPos = false;
						Vector3[] array = this.shoulderPos;
						if (array == null)
						{
							array = this.armPos;
						}
						if (array != null)
						{
							this._centerArmPos = (array[0] + array[1]) * 0.5f;
						}
					}
				}

				// Token: 0x060007DE RID: 2014 RVA: 0x000474F0 File Offset: 0x000456F0
				public void _UpdateCenterLegPos()
				{
					if (this._isDirtyCenterLegPos)
					{
						this._isDirtyCenterLegPos = false;
						Vector3[] array = this.legPos;
						if (array != null)
						{
							this._centerLegPos = (array[0] + array[1]) * 0.5f;
						}
					}
				}

				// Token: 0x060007DF RID: 2015 RVA: 0x00047549 File Offset: 0x00045749
				public void _SetCenterArmPos(ref Vector3 centerArmPos)
				{
					this._isDirtyCenterArmPos = false;
					this._centerArmPos = centerArmPos;
				}

				// Token: 0x060007E0 RID: 2016 RVA: 0x0004755E File Offset: 0x0004575E
				public void _SetCenterLegPos(ref Vector3 centerLegPos)
				{
					this._isDirtyCenterLegPos = false;
					this._centerLegPos = centerLegPos;
				}

				// Token: 0x17000110 RID: 272
				// (get) Token: 0x060007E1 RID: 2017 RVA: 0x00047573 File Offset: 0x00045773
				public FullBodyIK.Matrix3x3 centerLegBasis
				{
					get
					{
						if (this._isDirtyCenterLegBasis)
						{
							this._UpdateCenterLegBasis();
						}
						return this._centerLegBasis;
					}
				}

				// Token: 0x17000111 RID: 273
				// (get) Token: 0x060007E2 RID: 2018 RVA: 0x0004758C File Offset: 0x0004578C
				public FullBodyIK.Matrix3x3 spineUBasis
				{
					get
					{
						if (this._isDirtySpineUBasis)
						{
							this._UpdateSpineUBasis();
						}
						return this._spineUBasis;
					}
				}

				// Token: 0x060007E3 RID: 2019 RVA: 0x000475A8 File Offset: 0x000457A8
				public void _UpdateCenterLegBasis()
				{
					if (this._isDirtyCenterLegBasis)
					{
						this._isDirtyCenterLegBasis = false;
						Vector3[] array = this.legPos;
						this._centerLegBasis = FullBodyIK.Matrix3x3.identity;
						if (this.spinePos != null && this.spinePos.Length > 0 && array != null)
						{
							Vector3 lhs = array[1] - array[0];
							Vector3 vector = this.spinePos[0] - this.centerLegPos;
							Vector3 rhs = Vector3.Cross(lhs, vector);
							lhs = Vector3.Cross(vector, rhs);
							if (FullBodyIK.SAFBIKVecNormalize3(ref lhs, ref vector, ref rhs))
							{
								this._centerLegBasis.SetColumn(ref lhs, ref vector, ref rhs);
								FullBodyIK.SAFBIKMatMultRet0(ref this._centerLegBasis, ref this._centerLegBoneBasisInv);
							}
						}
					}
				}

				// Token: 0x060007E4 RID: 2020 RVA: 0x00047678 File Offset: 0x00045878
				public void _UpdateSpineUBasis()
				{
					if (this._isDirtySpineUBasis)
					{
						this._isDirtySpineUBasis = false;
						this._spineUBasis = FullBodyIK.Matrix3x3.identity;
						Vector3 vector = (this.shoulderPos == null) ? (this.armPos[1] + this.armPos[0]) : (this.shoulderPos[1] + this.shoulderPos[0]);
						vector = vector * 0.5f - this.spineUPos;
						Vector3 lhs = (this.shoulderPos == null) ? (this.armPos[1] - this.armPos[0]) : (this.shoulderPos[1] - this.shoulderPos[0]);
						Vector3 rhs = Vector3.Cross(lhs, vector);
						lhs = Vector3.Cross(vector, rhs);
						if (FullBodyIK.SAFBIKVecNormalize3(ref lhs, ref vector, ref rhs))
						{
							this._spineUBasis.SetColumn(ref lhs, ref vector, ref rhs);
							FullBodyIK.SAFBIKMatMultRet0(ref this._spineUBasis, ref this._spineUBoneLocalAxisBasisInv);
						}
					}
				}

				// Token: 0x060007E5 RID: 2021 RVA: 0x000477B9 File Offset: 0x000459B9
				public void SetDirtyVariables()
				{
					this._isDirtyCenterArmPos = true;
					this._isDirtyCenterLegPos = true;
					this._isDirtyCenterLegBasis = true;
					this._isDirtySpineUBasis = true;
				}

				// Token: 0x17000112 RID: 274
				// (get) Token: 0x060007E6 RID: 2022 RVA: 0x000477D7 File Offset: 0x000459D7
				public Vector3 spineUPos
				{
					get
					{
						if (this.spinePos != null && this.spinePos.Length != 0)
						{
							return this.spinePos[this.spinePos.Length - 1];
						}
						return Vector3.zero;
					}
				}

				// Token: 0x060007E7 RID: 2023 RVA: 0x00047814 File Offset: 0x00045A14
				public void Backup()
				{
					this._backupData.centerArmPos = this.centerArmPos;
					this._backupData.centerLegPos = this.centerLegPos;
					this._backupData.centerLegBasis = this.centerLegBasis;
					this._backupData.spineUBasis = this.spineUBasis;
					FullBodyIK.CloneArray<Vector3>(ref this._backupData.spinePos, this.spinePos);
					this._backupData.neckPos = this.neckPos;
					this._backupData.headPos = this.headPos;
					FullBodyIK.CloneArray<Vector3>(ref this._backupData.shoulderPos, this.shoulderPos);
					FullBodyIK.CloneArray<Vector3>(ref this._backupData.armPos, this.arms.beginPos);
					FullBodyIK.CloneArray<Vector3>(ref this._backupData.legPos, this.legs.beginPos);
				}

				// Token: 0x060007E8 RID: 2024 RVA: 0x000478EC File Offset: 0x00045AEC
				public void Restore()
				{
					this._isDirtyCenterArmPos = false;
					this._isDirtyCenterLegPos = false;
					this._isDirtyCenterLegBasis = false;
					this._isDirtySpineUBasis = false;
					this._centerArmPos = this._backupData.centerArmPos;
					this._centerLegPos = this._backupData.centerLegPos;
					this._centerLegBasis = this._backupData.centerLegBasis;
					this._spineUBasis = this._backupData.spineUBasis;
					FullBodyIK.CloneArray<Vector3>(ref this.spinePos, this._backupData.spinePos);
					this.neckPos = this._backupData.neckPos;
					this.headPos = this._backupData.headPos;
					FullBodyIK.CloneArray<Vector3>(ref this.shoulderPos, this._backupData.shoulderPos);
					FullBodyIK.CloneArray<Vector3>(ref this.arms.beginPos, this._backupData.armPos);
					FullBodyIK.CloneArray<Vector3>(ref this.legs.beginPos, this._backupData.legPos);
				}

				// Token: 0x060007E9 RID: 2025 RVA: 0x000479E0 File Offset: 0x00045BE0
				private void _SolveArmsToArms(ref FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp armsTemp, float armPull, int idx0)
				{
					Vector3 b = this._upperSolverTemp.targetArmPos[idx0];
					armsTemp.armPos[idx0] = Vector3.Lerp(armsTemp.armPos[idx0], b, armPull);
				}

				// Token: 0x060007EA RID: 2026 RVA: 0x00047A30 File Offset: 0x00045C30
				private void _SolveArmsToNeck(ref FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp armsTemp, float neckToFullArmPull, int idx0)
				{
					Vector3 a = armsTemp.nearArmPos[idx0];
					FullBodyIK.BodyIK._KeepLength(ref a, ref this._upperSolverTemp.targetNeckPos, this._solverCaches.nearArmToNeckLength[idx0]);
					armsTemp.nearArmPos[idx0] = Vector3.Lerp(a, armsTemp.nearArmPos[idx0], neckToFullArmPull);
				}

				// Token: 0x060007EB RID: 2027 RVA: 0x00047A98 File Offset: 0x00045C98
				private void _SolveArms(ref FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp armsTemp, int idx0)
				{
					int num = 1 - idx0;
					float neckHeadPull = this._solverCaches.neckHeadPull;
					float[] armPull = this._solverCaches.armPull;
					float[] elbowPull = this._solverCaches.elbowPull;
					float[] wristPull = this._solverCaches.wristPull;
					float[] neckHeadToFullArmPull = this._solverCaches.neckHeadToFullArmPull;
					if (wristPull[idx0] > 1E-07f || elbowPull[idx0] > 1E-07f || armPull[idx0] > 1E-07f || neckHeadPull > 1E-07f)
					{
						if (armPull[idx0] > 1E-07f)
						{
							this._SolveArmsToArms(ref armsTemp, armPull[idx0], idx0);
						}
						if ((wristPull[idx0] > 1E-07f || elbowPull[idx0] > 1E-07f) && this.arms.SolveTargetBeginPos(idx0, ref armsTemp.armPos[idx0]))
						{
							armsTemp.armPos[idx0] = this.arms.targetBeginPos[idx0];
							if (armsTemp.shoulderEnabled)
							{
								FullBodyIK.BodyIK._KeepLength(ref armsTemp.shoulderPos[idx0], ref armsTemp.armPos[idx0], this._solverCaches.shoulderToArmLength[idx0]);
								if (neckHeadPull > 1E-07f)
								{
									this._SolveArmsToNeck(ref armsTemp, neckHeadToFullArmPull[idx0], idx0);
									FullBodyIK.BodyIK._KeepLength(ref armsTemp.armPos[idx0], ref armsTemp.shoulderPos[idx0], this._solverCaches.shoulderToArmLength[idx0]);
								}
								FullBodyIK.BodyIK._KeepLength(ref armsTemp.shoulderPos[num], ref armsTemp.shoulderPos[idx0], this._solverCaches.nearArmToNearArmLen);
								FullBodyIK.BodyIK._KeepLength(ref armsTemp.armPos[num], ref armsTemp.shoulderPos[num], this._solverCaches.shoulderToArmLength[num]);
							}
							else
							{
								if (neckHeadPull > 1E-07f)
								{
									this._SolveArmsToNeck(ref armsTemp, neckHeadToFullArmPull[idx0], idx0);
								}
								FullBodyIK.BodyIK._KeepLength(ref armsTemp.armPos[num], ref armsTemp.armPos[idx0], this._solverCaches.armToArmLen);
							}
						}
						else if (armPull[idx0] > 1E-07f || neckHeadPull > 1E-07f)
						{
							if (armPull[idx0] > 1E-07f && armsTemp.shoulderEnabled)
							{
								FullBodyIK.BodyIK._KeepLength(ref armsTemp.shoulderPos[idx0], ref armsTemp.armPos[idx0], this._solverCaches.shoulderToArmLength[idx0]);
							}
							if (neckHeadPull > 1E-07f)
							{
								this._SolveArmsToNeck(ref armsTemp, neckHeadToFullArmPull[idx0], idx0);
								if (armsTemp.shoulderEnabled)
								{
									FullBodyIK.BodyIK._KeepLength(ref armsTemp.armPos[idx0], ref armsTemp.shoulderPos[idx0], this._solverCaches.shoulderToArmLength[idx0]);
								}
							}
							if (armsTemp.shoulderEnabled)
							{
								FullBodyIK.BodyIK._KeepLength(ref armsTemp.shoulderPos[num], ref armsTemp.shoulderPos[idx0], this._solverCaches.nearArmToNearArmLen);
								FullBodyIK.BodyIK._KeepLength(ref armsTemp.armPos[num], ref armsTemp.shoulderPos[num], this._solverCaches.shoulderToArmLength[num]);
							}
							else
							{
								FullBodyIK.BodyIK._KeepLength(ref armsTemp.armPos[num], ref armsTemp.armPos[idx0], this._solverCaches.armToArmLen);
							}
						}
					}
				}

				// Token: 0x17000113 RID: 275
				// (get) Token: 0x060007EC RID: 2028 RVA: 0x00047DDC File Offset: 0x00045FDC
				public Vector3 currentCenterArmPos
				{
					get
					{
						if (this.shoulderPos != null)
						{
							return (this.shoulderPos[0] + this.shoulderPos[1]) * 0.5f;
						}
						if (this.armPos != null)
						{
							return (this.armPos[0] + this.armPos[1]) * 0.5f;
						}
						return Vector3.zero;
					}
				}

				// Token: 0x17000114 RID: 276
				// (get) Token: 0x060007ED RID: 2029 RVA: 0x00047E68 File Offset: 0x00046068
				public Vector3 currentCenterArmDir
				{
					get
					{
						if (this.shoulderPos != null)
						{
							Vector3 result = this.shoulderPos[1] - this.shoulderPos[0];
							if (FullBodyIK.SAFBIKVecNormalize(ref result))
							{
								return result;
							}
						}
						else if (this.armPos != null)
						{
							Vector3 result2 = this.armPos[1] - this.armPos[0];
							if (FullBodyIK.SAFBIKVecNormalize(ref result2))
							{
								return result2;
							}
						}
						return Vector3.zero;
					}
				}

				// Token: 0x060007EE RID: 2030 RVA: 0x00047F04 File Offset: 0x00046104
				public bool UpperSolve()
				{
					this.targetCenterArmEnabled = false;
					float neckPull = this._solverCaches.neckPull;
					float headPull = this._solverCaches.headPull;
					float[] armPull = this._solverCaches.armPull;
					float[] elbowPull = this._solverCaches.elbowPull;
					float[] wristPull = this._solverCaches.wristPull;
					if (wristPull[0] <= 1E-07f && wristPull[1] <= 1E-07f && elbowPull[0] <= 1E-07f && elbowPull[1] <= 1E-07f && armPull[0] <= 1E-07f && armPull[1] <= 1E-07f && neckPull <= 1E-07f && headPull <= 1E-07f)
					{
						this.targetCenterArmPos = this.currentCenterArmPos;
						this.targetCenterArmDir = this.currentCenterArmDir;
						return false;
					}
					this._upperSolverTemp.targetNeckPos = ((this._neckEffector == null) ? this.neckPos : this._neckEffector._hidden_worldPosition);
					this._upperSolverTemp.targetHeadPos = ((this._headEffector == null) ? this.headPos : this._headEffector._hidden_worldPosition);
					this._upperSolverTemp.targetArmPos[0] = ((this._armEffectors == null) ? this.armPos[0] : this._armEffectors[0]._hidden_worldPosition);
					this._upperSolverTemp.targetArmPos[1] = ((this._armEffectors == null) ? this.armPos[1] : this._armEffectors[1]._hidden_worldPosition);
					this._upperSolverPreArmsTemp.neckPos = this.neckPos;
					this._upperSolverPreArmsTemp.armPos[0] = this.armPos[0];
					this._upperSolverPreArmsTemp.armPos[1] = this.armPos[1];
					this._upperSolverPreArmsTemp.shoulderEnabled = (this.shoulderPos != null);
					if (this._upperSolverPreArmsTemp.shoulderEnabled)
					{
						this._upperSolverPreArmsTemp.shoulderPos[0] = this.shoulderPos[0];
						this._upperSolverPreArmsTemp.shoulderPos[1] = this.shoulderPos[1];
						this._upperSolverPreArmsTemp.nearArmPos = this._upperSolverPreArmsTemp.shoulderPos;
					}
					else
					{
						this._upperSolverPreArmsTemp.nearArmPos = this._upperSolverPreArmsTemp.armPos;
					}
					float upperBodyMovingfixRate = this.settings.bodyIK.upperBodyMovingfixRate;
					float upperHeadMovingfixRate = this.settings.bodyIK.upperHeadMovingfixRate;
					if (upperBodyMovingfixRate > 1E-07f || upperHeadMovingfixRate > 1E-07f)
					{
						Vector3 vector = Vector3.zero;
						Vector3 vector2 = Vector3.zero;
						if (headPull > 1E-07f)
						{
							vector = this._upperSolverTemp.targetHeadPos - this.headPos;
							if (upperHeadMovingfixRate < 0.9999999f)
							{
								vector *= headPull * upperHeadMovingfixRate;
							}
							else
							{
								vector *= headPull;
							}
						}
						float num = 0f;
						if (neckPull > 1E-07f || armPull[0] > 1E-07f || armPull[1] > 1E-07f)
						{
							num = neckPull + armPull[0] + armPull[1];
							float num2 = 1f / num;
							if (neckPull > 1E-07f)
							{
								vector2 = (this._upperSolverTemp.targetNeckPos - this.neckPos) * (neckPull * neckPull);
							}
							if (armPull[0] > 1E-07f)
							{
								vector2 += (this._upperSolverTemp.targetArmPos[0] - this.armPos[0]) * (armPull[0] * armPull[0]);
							}
							if (armPull[1] > 1E-07f)
							{
								vector2 += (this._upperSolverTemp.targetArmPos[1] - this.armPos[1]) * (armPull[1] * armPull[1]);
							}
							if (upperBodyMovingfixRate < 0.9999999f)
							{
								vector2 *= num2 * upperBodyMovingfixRate;
							}
							else
							{
								vector2 *= num2;
							}
						}
						Vector3 vector3 = default(Vector3);
						if (headPull > 1E-07f && num > 1E-07f)
						{
							vector3 = vector * headPull + vector2 * num;
							vector3 *= 1f / (headPull + num);
						}
						else if (headPull > 1E-07f)
						{
							vector3 = vector;
						}
						else
						{
							vector3 = vector2;
						}
						this._upperSolverPreArmsTemp.neckPos = this._upperSolverPreArmsTemp.neckPos + vector3;
						this._upperSolverPreArmsTemp.armPos[0] += vector3;
						this._upperSolverPreArmsTemp.armPos[1] += vector3;
						if (this._upperSolverPreArmsTemp.shoulderEnabled)
						{
							this._upperSolverPreArmsTemp.shoulderPos[0] += vector3;
							this._upperSolverPreArmsTemp.shoulderPos[1] += vector3;
						}
					}
					if ((upperHeadMovingfixRate < 0.9999999f || upperBodyMovingfixRate < 0.9999999f) && (headPull > 1E-07f || neckPull > 1E-07f))
					{
						if (upperHeadMovingfixRate < 0.9999999f && headPull > 1E-07f)
						{
							Vector3 b = this._upperSolverPreArmsTemp.neckPos;
							if (FullBodyIK.BodyIK._KeepMaxLength(ref b, ref this._upperSolverTemp.targetHeadPos, this._solverCaches.neckToHeadLength))
							{
								this._upperSolverPreArmsTemp.neckPos = Vector3.Lerp(this._upperSolverPreArmsTemp.neckPos, b, headPull);
							}
						}
						for (int num3 = 0; num3 != 2; num3++)
						{
							if (upperBodyMovingfixRate < 0.9999999f && neckPull > 1E-07f)
							{
								Vector3 b2 = this._upperSolverPreArmsTemp.nearArmPos[num3];
								FullBodyIK.BodyIK._KeepLength(ref b2, ref this._upperSolverTemp.targetNeckPos, this._solverCaches.nearArmToNeckLength[num3]);
								this._upperSolverPreArmsTemp.nearArmPos[num3] = Vector3.Lerp(this._upperSolverPreArmsTemp.nearArmPos[num3], b2, neckPull);
							}
							else
							{
								FullBodyIK.BodyIK._KeepLength(ref this._upperSolverPreArmsTemp.nearArmPos[num3], ref this._upperSolverPreArmsTemp.neckPos, this._solverCaches.nearArmToNeckLength[num3]);
							}
							if (this._upperSolverPreArmsTemp.shoulderEnabled)
							{
								FullBodyIK.BodyIK._KeepLength(ref this._upperSolverPreArmsTemp.armPos[num3], ref this._upperSolverPreArmsTemp.shoulderPos[num3], this._solverCaches.shoulderToArmLength[num3]);
							}
						}
					}
					this._upperSolverTemp.targetNeckPos = this._upperSolverPreArmsTemp.neckPos;
					for (int num4 = 0; num4 != 2; num4++)
					{
						this._upperSolverArmsTemps[num4].armPos[0] = this._upperSolverPreArmsTemp.armPos[0];
						this._upperSolverArmsTemps[num4].armPos[1] = this._upperSolverPreArmsTemp.armPos[1];
						this._upperSolverArmsTemps[num4].shoulderEnabled = this._upperSolverPreArmsTemp.shoulderEnabled;
						if (this._upperSolverArmsTemps[num4].shoulderEnabled)
						{
							this._upperSolverArmsTemps[num4].shoulderPos[0] = this._upperSolverPreArmsTemp.shoulderPos[0];
							this._upperSolverArmsTemps[num4].shoulderPos[1] = this._upperSolverPreArmsTemp.shoulderPos[1];
							this._upperSolverArmsTemps[num4].nearArmPos = this._upperSolverArmsTemps[num4].shoulderPos;
						}
						else
						{
							this._upperSolverArmsTemps[num4].nearArmPos = this._upperSolverArmsTemps[num4].armPos;
						}
					}
					bool flag = wristPull[0] > 1E-07f || elbowPull[0] > 1E-07f || armPull[0] > 1E-07f;
					bool flag2 = wristPull[1] > 1E-07f || elbowPull[1] > 1E-07f || armPull[1] > 1E-07f;
					float neckHeadPull = this._solverCaches.neckHeadPull;
					if ((flag && flag2) || neckHeadPull > 1E-07f)
					{
						for (int num5 = 0; num5 != 2; num5++)
						{
							int num6 = num5;
							int idx = 1 - num5;
							this._SolveArms(ref this._upperSolverArmsTemps[num6], num6);
							this._SolveArms(ref this._upperSolverArmsTemps[num6], idx);
							this._SolveArms(ref this._upperSolverArmsTemps[num6], num6);
							if (this._upperSolverArmsTemps[num6].shoulderEnabled)
							{
								this._upperSolverArmsTemps[num6].centerArmPos = (this._upperSolverArmsTemps[num6].shoulderPos[0] + this._upperSolverArmsTemps[num6].shoulderPos[1]) * 0.5f;
								this._upperSolverArmsTemps[num6].centerArmDir = this._upperSolverArmsTemps[num6].shoulderPos[1] - this._upperSolverArmsTemps[num6].shoulderPos[0];
							}
							else
							{
								this._upperSolverArmsTemps[num6].centerArmPos = (this._upperSolverArmsTemps[num6].armPos[0] + this._upperSolverArmsTemps[num6].armPos[1]) * 0.5f;
								this._upperSolverArmsTemps[num6].centerArmDir = this._upperSolverArmsTemps[num6].armPos[1] - this._upperSolverArmsTemps[num6].armPos[0];
							}
						}
						if (!FullBodyIK.SAFBIKVecNormalize2(ref this._upperSolverArmsTemps[0].centerArmDir, ref this._upperSolverArmsTemps[1].centerArmDir))
						{
							return false;
						}
						float limbArmRate = this._solverCaches.limbArmRate;
						this.targetCenterArmEnabled = true;
						this.targetCenterArmPos = Vector3.Lerp(this._upperSolverArmsTemps[0].centerArmPos, this._upperSolverArmsTemps[1].centerArmPos, limbArmRate);
						this.targetCenterArmDir = FullBodyIK._LerpDir(ref this._upperSolverArmsTemps[0].centerArmDir, ref this._upperSolverArmsTemps[1].centerArmDir, limbArmRate);
					}
					else
					{
						int num7 = (!flag) ? 1 : 0;
						this._SolveArms(ref this._upperSolverArmsTemps[num7], num7);
						if (this._upperSolverArmsTemps[num7].shoulderEnabled)
						{
							this._upperSolverArmsTemps[num7].centerArmPos = (this._upperSolverArmsTemps[num7].shoulderPos[0] + this._upperSolverArmsTemps[num7].shoulderPos[1]) * 0.5f;
							this._upperSolverArmsTemps[num7].centerArmDir = this._upperSolverArmsTemps[num7].shoulderPos[1] - this._upperSolverArmsTemps[num7].shoulderPos[0];
						}
						else
						{
							this._upperSolverArmsTemps[num7].centerArmPos = (this._upperSolverArmsTemps[num7].armPos[0] + this._upperSolverArmsTemps[num7].armPos[1]) * 0.5f;
							this._upperSolverArmsTemps[num7].centerArmDir = this._upperSolverArmsTemps[num7].armPos[1] - this._upperSolverArmsTemps[num7].armPos[0];
						}
						if (!FullBodyIK.SAFBIKVecNormalize(ref this._upperSolverArmsTemps[num7].centerArmDir))
						{
							return false;
						}
						this.targetCenterArmEnabled = true;
						this.targetCenterArmPos = this._upperSolverArmsTemps[num7].centerArmPos;
						this.targetCenterArmDir = this._upperSolverArmsTemps[num7].centerArmDir;
					}
					return true;
				}

				// Token: 0x060007EF RID: 2031 RVA: 0x00048CAC File Offset: 0x00046EAC
				public bool ShoulderResolve()
				{
					FullBodyIK.Bone[] armBones = this._solverCaches.armBones;
					FullBodyIK.Bone[] shoulderBones = this._solverCaches.shoulderBones;
					float[] shoulderToArmLength = this._solverCaches.shoulderToArmLength;
					if (armBones == null || shoulderBones == null)
					{
						return false;
					}
					if (!this._limbIK[2].IsSolverEnabled() && !this._limbIK[3].IsSolverEnabled())
					{
						return false;
					}
					for (int num = 0; num != 2; num++)
					{
						int num2 = (num != 0) ? 3 : 2;
						if (this._limbIK[num2].IsSolverEnabled())
						{
							Vector3 vector = this.armPos[num] - this.shoulderPos[num];
							Vector3 rhs;
							if (this.internalValues.shoulderDirYAsNeck != 0)
							{
								rhs = this.neckPos - this.shoulderPos[num];
							}
							else
							{
								rhs = this.shoulderPos[num] - this.spineUPos;
							}
							vector = ((num != 0) ? vector : (-vector));
							Vector3 lhs = Vector3.Cross(vector, rhs);
							rhs = Vector3.Cross(lhs, vector);
							if (FullBodyIK.SAFBIKVecNormalize3(ref vector, ref rhs, ref lhs))
							{
								FullBodyIK.Matrix3x3 matrix3x = FullBodyIK.Matrix3x3.FromColumn(ref vector, ref rhs, ref lhs);
								FullBodyIK.SAFBIKMatMult(out this._tempParentBasis[num], ref matrix3x, ref this._shoulderBones[num]._boneToBaseBasis);
							}
							this._tempArmPos[num] = this.armPos[num];
							this._tempElbowPosEnabled[num] = this._limbIK[num2].Presolve(ref this._tempParentBasis[num], ref this._tempArmPos[num], out this._tempArmToElbowDir[num], out this._tempElbowToWristDir[num]);
							if (this._tempElbowPosEnabled[num])
							{
								FullBodyIK.SAFBIKMatMultCol0(out this._tempArmToElbowDefaultDir[num], ref this._tempParentBasis[num], ref this._armBones[num]._baseToBoneBasis);
								if (num == 0)
								{
									this._tempArmToElbowDefaultDir[num] = -this._tempArmToElbowDefaultDir[num];
								}
							}
						}
					}
					if (!this._tempElbowPosEnabled[0] && !this._tempElbowPosEnabled[1])
					{
						return false;
					}
					float shoulderSolveBendingRate = this.settings.bodyIK.shoulderSolveBendingRate;
					bool result = false;
					for (int num3 = 0; num3 != 2; num3++)
					{
						if (this._tempElbowPosEnabled[num3])
						{
							float num4;
							Vector3 vector2;
							FullBodyIK._ComputeThetaAxis(ref this._tempArmToElbowDefaultDir[num3], ref this._tempArmToElbowDir[num3], out num4, out vector2);
							if (num4 < -1E-45f || num4 > 1E-45f)
							{
								result = true;
								num4 = FullBodyIK.SAFBIKCos(FullBodyIK.SAFBIKAcos(num4) * shoulderSolveBendingRate);
								FullBodyIK.Matrix3x3 matrix3x2 = default(FullBodyIK.Matrix3x3);
								FullBodyIK.SAFBIKMatSetAxisAngle(out matrix3x2, ref vector2, num4);
								Vector3 vector3 = this.shoulderPos[num3];
								Vector3 vector4 = this._tempArmPos[num3] - vector3;
								FullBodyIK.SAFBIKVecNormalize(ref vector4);
								Vector3 a;
								FullBodyIK.SAFBIKMatMultVec(out a, ref matrix3x2, ref vector4);
								Vector3 vector5 = vector3 + a * shoulderToArmLength[num3];
								this.SolveShoulderToArmInternal(num3, ref vector5);
							}
						}
					}
					return result;
				}

				// Token: 0x060007F0 RID: 2032 RVA: 0x00049014 File Offset: 0x00047214
				public bool PrepareLowerRotation(int origIndex)
				{
					bool flag = false;
					for (int i = 0; i < 2; i++)
					{
						this.legs.SolveTargetBeginPos(i);
						flag |= this._PrepareLimbRotation(this.legs, i, origIndex, ref this.legs.beginPos[i]);
					}
					return flag;
				}

				// Token: 0x060007F1 RID: 2033 RVA: 0x00049068 File Offset: 0x00047268
				public bool _PrepareLimbRotation(FullBodyIK.BodyIK.SolverInternal.Limb limb, int i, int origIndex, ref Vector3 beginPos)
				{
					this.origTheta[i] = 0f;
					this.origAxis[i] = new Vector3(0f, 0f, 1f);
					if (!limb.targetBeginPosEnabled[i])
					{
						return false;
					}
					Vector3[] targetBeginPos = limb.targetBeginPos;
					Vector3 vector = (origIndex != -1) ? this.spinePos[origIndex] : this.centerLegPos;
					return FullBodyIK._ComputeThetaAxis(ref vector, ref beginPos, ref targetBeginPos[i], out this.origTheta[i], out this.origAxis[i]);
				}

				// Token: 0x060007F2 RID: 2034 RVA: 0x0004910C File Offset: 0x0004730C
				public void SetSolveFeedbackRate(float feedbackRate)
				{
					for (int i = 0; i < this.origFeedbackRate.Length; i++)
					{
						this.origFeedbackRate[i] = feedbackRate;
					}
				}

				// Token: 0x060007F3 RID: 2035 RVA: 0x0004913B File Offset: 0x0004733B
				public void SetSolveFeedbackRate(int i, float feedbackRate)
				{
					this.origFeedbackRate[i] = feedbackRate;
				}

				// Token: 0x060007F4 RID: 2036 RVA: 0x00049146 File Offset: 0x00047346
				public bool SolveLowerRotation(int origIndex, out Quaternion origRotation)
				{
					return this._SolveLimbRotation(this.legs, origIndex, out origRotation);
				}

				// Token: 0x060007F5 RID: 2037 RVA: 0x00049158 File Offset: 0x00047358
				private bool _SolveLimbRotation(FullBodyIK.BodyIK.SolverInternal.Limb limb, int origIndex, out Quaternion origRotation)
				{
					origRotation = Quaternion.identity;
					int num = -1;
					int num2 = 0;
					for (int i = 0; i < 2; i++)
					{
						if (limb.targetBeginPosEnabled[i])
						{
							num = i;
							num2++;
						}
					}
					if (num2 == 0)
					{
						return false;
					}
					float num3 = (limb != this.arms) ? this._solverCaches.limbLegRate : this._solverCaches.limbArmRate;
					if (num2 != 1)
					{
						Quaternion a = FullBodyIK.BodyIK._GetRotation(ref this.origAxis[0], this.origTheta[0], this.origFeedbackRate[0] * 0.5f);
						Quaternion b = FullBodyIK.BodyIK._GetRotation(ref this.origAxis[1], this.origTheta[1], this.origFeedbackRate[1] * 0.5f);
						origRotation = Quaternion.Lerp(a, b, num3);
						origRotation *= origRotation;
						return true;
					}
					int num4 = num;
					if (this.origTheta[num4] == 0f)
					{
						return false;
					}
					if (num4 == 0)
					{
						num3 = 1f - num3;
					}
					origRotation = FullBodyIK.BodyIK._GetRotation(ref this.origAxis[num4], this.origTheta[num4], this.origFeedbackRate[num4] * num3);
					return true;
				}

				// Token: 0x060007F6 RID: 2038 RVA: 0x000492A0 File Offset: 0x000474A0
				public void UpperRotation(int origIndex, ref FullBodyIK.Matrix3x3 origBasis)
				{
					Vector3 vector = (origIndex != -1) ? this.spinePos[origIndex] : this.centerLegPos;
					Vector3[] array = this.armPos;
					if (array != null)
					{
						for (int i = 0; i < array.Length; i++)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out array[i], ref origBasis, ref array[i], ref vector, ref vector);
						}
					}
					if (this.shoulderPos != null)
					{
						for (int j = 0; j < this.shoulderPos.Length; j++)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.shoulderPos[j], ref origBasis, ref this.shoulderPos[j], ref vector, ref vector);
						}
					}
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.neckPos, ref origBasis, ref this.neckPos, ref vector, ref vector);
					if (this.headEnabled)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.headPos, ref origBasis, ref this.headPos, ref vector, ref vector);
					}
					if (origIndex == -1)
					{
						Vector3[] array2 = this.legPos;
						if (array2 != null)
						{
							for (int k = 0; k < array2.Length; k++)
							{
								FullBodyIK.SAFBIKMatMultVecPreSubAdd(out array2[k], ref origBasis, ref array2[k], ref vector, ref vector);
							}
						}
						this._isDirtyCenterLegBasis = true;
					}
					for (int l = (origIndex != -1) ? origIndex : 0; l < this.spinePos.Length; l++)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.spinePos[l], ref origBasis, ref this.spinePos[l], ref vector, ref vector);
					}
					this._isDirtyCenterArmPos = true;
					this._isDirtySpineUBasis = true;
				}

				// Token: 0x060007F7 RID: 2039 RVA: 0x00049438 File Offset: 0x00047638
				public void LowerRotation(int origIndex, ref Quaternion origRotation, bool bodyRotation)
				{
					FullBodyIK.Matrix3x3 matrix3x = new FullBodyIK.Matrix3x3(origRotation);
					this.LowerRotation(origIndex, ref matrix3x, bodyRotation);
				}

				// Token: 0x060007F8 RID: 2040 RVA: 0x0004945C File Offset: 0x0004765C
				public void LowerRotation(int origIndex, ref FullBodyIK.Matrix3x3 origBasis, bool bodyRotation)
				{
					Vector3 vector = (origIndex != -1) ? this.spinePos[origIndex] : this.centerLegPos;
					Vector3[] array = this.legPos;
					if (array != null)
					{
						for (int i = 0; i < 2; i++)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out array[i], ref origBasis, ref array[i], ref vector, ref vector);
						}
					}
					if (this.spinePos != null)
					{
						int num = (!bodyRotation) ? origIndex : this.spinePos.Length;
						for (int j = 0; j < num; j++)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.spinePos[j], ref origBasis, ref this.spinePos[j], ref vector, ref vector);
						}
					}
					this._isDirtyCenterArmPos = true;
					this._isDirtyCenterLegPos = true;
					this._isDirtyCenterLegBasis = true;
					if (bodyRotation || this.spinePos == null || origIndex + 1 == this.spinePos.Length)
					{
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.neckPos, ref origBasis, ref this.neckPos, ref vector, ref vector);
						if (this.headEnabled)
						{
							FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.headPos, ref origBasis, ref this.headPos, ref vector, ref vector);
						}
						Vector3[] array2 = this.armPos;
						if (array2 != null)
						{
							for (int k = 0; k < 2; k++)
							{
								FullBodyIK.SAFBIKMatMultVecPreSubAdd(out array2[k], ref origBasis, ref array2[k], ref vector, ref vector);
							}
						}
						if (this.shoulderPos != null)
						{
							for (int l = 0; l < 2; l++)
							{
								FullBodyIK.SAFBIKMatMultVecPreSubAdd(out this.shoulderPos[l], ref origBasis, ref this.shoulderPos[l], ref vector, ref vector);
							}
						}
						this._isDirtySpineUBasis = true;
					}
				}

				// Token: 0x060007F9 RID: 2041 RVA: 0x00049618 File Offset: 0x00047818
				public bool PrepareLowerTranslate()
				{
					bool flag = false;
					for (int i = 0; i < 2; i++)
					{
						this.legs.SolveTargetBeginPos(i);
						flag |= this._PrepareLimbTranslate(this.legs, i, ref this.legs.beginPos[i]);
					}
					return flag;
				}

				// Token: 0x060007FA RID: 2042 RVA: 0x00049668 File Offset: 0x00047868
				private bool _PrepareLimbTranslate(FullBodyIK.BodyIK.SolverInternal.Limb limb, int i, ref Vector3 beginPos)
				{
					this.origTranslate[i] = Vector3.zero;
					if (limb.targetBeginPosEnabled[i])
					{
						this.origTranslate[i] = limb.targetBeginPos[i] - beginPos;
						return true;
					}
					return false;
				}

				// Token: 0x060007FB RID: 2043 RVA: 0x000496C8 File Offset: 0x000478C8
				public bool SolveLowerTranslate(out Vector3 translate)
				{
					return this._SolveLimbTranslate(this.legs, out translate);
				}

				// Token: 0x060007FC RID: 2044 RVA: 0x000496D8 File Offset: 0x000478D8
				private bool _SolveLimbTranslate(FullBodyIK.BodyIK.SolverInternal.Limb limb, out Vector3 origTranslate)
				{
					origTranslate = Vector3.zero;
					float num = (limb != this.arms) ? this._solverCaches.limbLegRate : this._solverCaches.limbArmRate;
					if (limb.targetBeginPosEnabled[0] && limb.targetBeginPosEnabled[1])
					{
						origTranslate = Vector3.Lerp(this.origTranslate[0], this.origTranslate[1], num);
					}
					else if (limb.targetBeginPosEnabled[0] || limb.targetBeginPosEnabled[1])
					{
						int num2 = (!limb.targetBeginPosEnabled[0]) ? 1 : 0;
						float d = (!limb.targetBeginPosEnabled[0]) ? num : (1f - num);
						origTranslate = this.origTranslate[num2] * d;
					}
					return origTranslate != Vector3.zero;
				}

				// Token: 0x060007FD RID: 2045 RVA: 0x000497DC File Offset: 0x000479DC
				public void LowerTranslateBeginOnly(ref Vector3 origTranslate)
				{
					this._LimbTranslateBeginOnly(this.legs, ref origTranslate);
					this._centerLegPos += origTranslate;
				}

				// Token: 0x060007FE RID: 2046 RVA: 0x00049804 File Offset: 0x00047A04
				private void _LimbTranslateBeginOnly(FullBodyIK.BodyIK.SolverInternal.Limb limb, ref Vector3 origTranslate)
				{
					for (int i = 0; i < 2; i++)
					{
						limb.beginPos[i] += origTranslate;
					}
				}

				// Token: 0x060007FF RID: 2047 RVA: 0x00049848 File Offset: 0x00047A48
				public void Translate(ref Vector3 origTranslate)
				{
					this._centerArmPos += origTranslate;
					this._centerLegPos += origTranslate;
					if (this.spinePos != null)
					{
						for (int num = 0; num != this.spinePos.Length; num++)
						{
							this.spinePos[num] += origTranslate;
						}
					}
					this.neckPos += origTranslate;
					if (this.headEnabled)
					{
						this.headPos += origTranslate;
					}
					for (int num2 = 0; num2 != 2; num2++)
					{
						if (this.legPos != null)
						{
							this.legPos[num2] += origTranslate;
						}
						if (this.shoulderPos != null)
						{
							this.shoulderPos[num2] += origTranslate;
						}
						if (this.armPos != null)
						{
							this.armPos[num2] += origTranslate;
						}
					}
				}

				// Token: 0x06000800 RID: 2048 RVA: 0x0004999C File Offset: 0x00047B9C
				public void SolveShoulderToArmInternal(int i, ref Vector3 destArmPos)
				{
					if (!this.settings.bodyIK.shoulderSolveEnabled)
					{
						return;
					}
					FullBodyIK.Bone[] shoulderBones = this._solverCaches.shoulderBones;
					float[] shoulderToArmLength = this._solverCaches.shoulderToArmLength;
					float num = this.internalValues.bodyIK.shoulderLimitThetaYPlus.sin;
					float num2 = this.internalValues.bodyIK.shoulderLimitThetaYMinus.sin;
					float sin = this.internalValues.bodyIK.shoulderLimitThetaZ.sin;
					if (shoulderBones == null)
					{
						return;
					}
					if (this._shouderLocalAxisYInv[i])
					{
						float num3 = num;
						num = num2;
						num2 = num3;
					}
					if (!FullBodyIK.IsFuzzy(ref this.armPos[i], ref destArmPos, 1E-07f))
					{
						Vector3 a = destArmPos - this.shoulderPos[i];
						if (FullBodyIK.SAFBIKVecNormalize(ref a))
						{
							if (this.settings.bodyIK.shoulderLimitEnabled)
							{
								FullBodyIK.Matrix3x3 spineUBasis = this.spineUBasis;
								FullBodyIK.SAFBIKMatMultRet0(ref spineUBasis, ref shoulderBones[i]._localAxisBasis);
								FullBodyIK.SAFBIKMatMultVecInv(out a, ref spineUBasis, ref a);
								FullBodyIK._LimitYZ_Square(i != 0, ref a, num2, num, sin, sin);
								FullBodyIK.SAFBIKMatMultVec(out a, ref spineUBasis, ref a);
							}
							this.armPos[i] = this.shoulderPos[i] + a * shoulderToArmLength[i];
						}
					}
				}

				// Token: 0x04000CB0 RID: 3248
				public FullBodyIK.Settings settings;

				// Token: 0x04000CB1 RID: 3249
				public FullBodyIK.InternalValues internalValues;

				// Token: 0x04000CB2 RID: 3250
				public bool[] _shouderLocalAxisYInv;

				// Token: 0x04000CB3 RID: 3251
				public FullBodyIK.Effector[] _armEffectors;

				// Token: 0x04000CB4 RID: 3252
				public FullBodyIK.Effector _neckEffector;

				// Token: 0x04000CB5 RID: 3253
				public FullBodyIK.Effector _headEffector;

				// Token: 0x04000CB6 RID: 3254
				public FullBodyIK.Bone[] _spineBones;

				// Token: 0x04000CB7 RID: 3255
				public FullBodyIK.Bone[] _shoulderBones;

				// Token: 0x04000CB8 RID: 3256
				public FullBodyIK.Bone[] _armBones;

				// Token: 0x04000CB9 RID: 3257
				public FullBodyIK.BodyIK.SolverInternal.Limb arms = new FullBodyIK.BodyIK.SolverInternal.Limb();

				// Token: 0x04000CBA RID: 3258
				public FullBodyIK.BodyIK.SolverInternal.Limb legs = new FullBodyIK.BodyIK.SolverInternal.Limb();

				// Token: 0x04000CBB RID: 3259
				public Vector3[] origToBeginDir = new Vector3[2];

				// Token: 0x04000CBC RID: 3260
				public Vector3[] origToTargetBeginDir = new Vector3[2];

				// Token: 0x04000CBD RID: 3261
				public float[] origTheta = new float[2];

				// Token: 0x04000CBE RID: 3262
				public Vector3[] origAxis = new Vector3[2];

				// Token: 0x04000CBF RID: 3263
				public Vector3[] origTranslate = new Vector3[2];

				// Token: 0x04000CC0 RID: 3264
				public float[] origFeedbackRate = new float[2];

				// Token: 0x04000CC1 RID: 3265
				public Vector3[] spinePos;

				// Token: 0x04000CC2 RID: 3266
				public Vector3 neckPos;

				// Token: 0x04000CC3 RID: 3267
				public Vector3 headPos;

				// Token: 0x04000CC4 RID: 3268
				public bool headEnabled;

				// Token: 0x04000CC5 RID: 3269
				public Vector3[] nearArmPos;

				// Token: 0x04000CC6 RID: 3270
				public Vector3[] shoulderPos;

				// Token: 0x04000CC7 RID: 3271
				public Vector3[] armPos = new Vector3[2];

				// Token: 0x04000CC8 RID: 3272
				public Vector3[] legPos = new Vector3[2];

				// Token: 0x04000CC9 RID: 3273
				public FullBodyIK.Matrix3x3 _centerLegBoneBasisInv = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000CCA RID: 3274
				public FullBodyIK.Matrix3x3 _spineUBoneLocalAxisBasisInv = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000CCB RID: 3275
				public Vector3 _centerArmPos = Vector3.zero;

				// Token: 0x04000CCC RID: 3276
				public Vector3 _centerLegPos = Vector3.zero;

				// Token: 0x04000CCD RID: 3277
				public FullBodyIK.Matrix3x3 _centerLegBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000CCE RID: 3278
				public FullBodyIK.Matrix3x3 _spineUBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000CCF RID: 3279
				private bool _isDirtyCenterArmPos = true;

				// Token: 0x04000CD0 RID: 3280
				private bool _isDirtyCenterLegPos = true;

				// Token: 0x04000CD1 RID: 3281
				private bool _isDirtyCenterLegBasis = true;

				// Token: 0x04000CD2 RID: 3282
				private bool _isDirtySpineUBasis = true;

				// Token: 0x04000CD3 RID: 3283
				private FullBodyIK.BodyIK.SolverInternal.BackupData _backupData = new FullBodyIK.BodyIK.SolverInternal.BackupData();

				// Token: 0x04000CD4 RID: 3284
				public FullBodyIK.Effector[] _wristEffectors;

				// Token: 0x04000CD5 RID: 3285
				public FullBodyIK.BodyIK.SolverCaches _solverCaches;

				// Token: 0x04000CD6 RID: 3286
				private FullBodyIK.BodyIK.SolverInternal._UpperSolverPreArmsTemp _upperSolverPreArmsTemp = FullBodyIK.BodyIK.SolverInternal._UpperSolverPreArmsTemp.Alloc();

				// Token: 0x04000CD7 RID: 3287
				private FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp[] _upperSolverArmsTemps = new FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp[]
				{
					FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp.Alloc(),
					FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp.Alloc()
				};

				// Token: 0x04000CD8 RID: 3288
				private FullBodyIK.BodyIK.SolverInternal._UpperSolverTemp _upperSolverTemp = FullBodyIK.BodyIK.SolverInternal._UpperSolverTemp.Alloc();

				// Token: 0x04000CD9 RID: 3289
				public bool targetCenterArmEnabled;

				// Token: 0x04000CDA RID: 3290
				public Vector3 targetCenterArmPos = Vector3.zero;

				// Token: 0x04000CDB RID: 3291
				public Vector3 targetCenterArmDir = Vector3.zero;

				// Token: 0x04000CDC RID: 3292
				private Vector3[] _tempArmPos = new Vector3[2];

				// Token: 0x04000CDD RID: 3293
				private Vector3[] _tempArmToElbowDir = new Vector3[2];

				// Token: 0x04000CDE RID: 3294
				private Vector3[] _tempElbowToWristDir = new Vector3[2];

				// Token: 0x04000CDF RID: 3295
				private bool[] _tempElbowPosEnabled = new bool[2];

				// Token: 0x04000CE0 RID: 3296
				public FullBodyIK.LimbIK[] _limbIK;

				// Token: 0x04000CE1 RID: 3297
				private FullBodyIK.Matrix3x3[] _tempParentBasis = new FullBodyIK.Matrix3x3[]
				{
					FullBodyIK.Matrix3x3.identity,
					FullBodyIK.Matrix3x3.identity
				};

				// Token: 0x04000CE2 RID: 3298
				private Vector3[] _tempArmToElbowDefaultDir = new Vector3[2];

				// Token: 0x02000190 RID: 400
				public class Limb
				{
					// Token: 0x06000802 RID: 2050 RVA: 0x00049B60 File Offset: 0x00047D60
					public void Prepare(FullBodyIK.Effector[] bendingEffectors, FullBodyIK.Effector[] endEffectors)
					{
						for (int i = 0; i < 2; i++)
						{
							this.targetBeginPos[i] = this.beginPos[i];
							this.targetBeginPosEnabled[i] = false;
							if (bendingEffectors[i] != null && bendingEffectors[i].bone != null && bendingEffectors[i].bone.transformIsAlive)
							{
								this.bendingPosEnabled[i] = true;
								this.bendingPos[i] = bendingEffectors[i]._hidden_worldPosition;
							}
							else
							{
								this.bendingPosEnabled[i] = false;
								this.bendingPos[i] = default(Vector3);
							}
							if (endEffectors[i] != null && endEffectors[i].bone != null && endEffectors[i].bone.transformIsAlive)
							{
								this.endPosEnabled[i] = true;
								this.endPos[i] = endEffectors[i]._hidden_worldPosition;
							}
							else
							{
								this.endPosEnabled[i] = false;
								this.endPos[i] = default(Vector3);
							}
						}
					}

					// Token: 0x06000803 RID: 2051 RVA: 0x00049C8C File Offset: 0x00047E8C
					public void ClearEnvTargetBeginPos()
					{
						for (int i = 0; i < 2; i++)
						{
							this._ClearEnvTargetBeginPos(i, ref this.beginPos[i]);
						}
					}

					// Token: 0x06000804 RID: 2052 RVA: 0x00049CBE File Offset: 0x00047EBE
					public void ClearEnvTargetBeginPos(int i)
					{
						this._ClearEnvTargetBeginPos(i, ref this.beginPos[i]);
					}

					// Token: 0x06000805 RID: 2053 RVA: 0x00049CD3 File Offset: 0x00047ED3
					public void _ClearEnvTargetBeginPos(int i, ref Vector3 beginPos)
					{
						this.targetBeginPos[i] = beginPos;
						this.targetBeginPosEnabled[i] = false;
					}

					// Token: 0x06000806 RID: 2054 RVA: 0x00049CF8 File Offset: 0x00047EF8
					public bool SolveTargetBeginPos()
					{
						bool flag = false;
						for (int i = 0; i < 2; i++)
						{
							flag |= this.SolveTargetBeginPos(i, ref this.beginPos[i]);
						}
						return flag;
					}

					// Token: 0x06000807 RID: 2055 RVA: 0x00049D30 File Offset: 0x00047F30
					public bool SolveTargetBeginPos(int i)
					{
						return this.SolveTargetBeginPos(i, ref this.beginPos[i]);
					}

					// Token: 0x06000808 RID: 2056 RVA: 0x00049D48 File Offset: 0x00047F48
					public bool SolveTargetBeginPos(int i, ref Vector3 beginPos)
					{
						this.targetBeginPos[i] = beginPos;
						this.targetBeginPosEnabled[i] = false;
						if (this.endPosEnabled[i] && this._endPull[i] > 1E-07f)
						{
							this.targetBeginPosEnabled[i] |= FullBodyIK.BodyIK.SolverInternal.Limb._SolveTargetBeginPos(ref this.targetBeginPos[i], ref this.endPos[i], ref this._beginToEndLength[i], this._endPull[i]);
						}
						if (this.bendingPosEnabled[i] && this._bendingPull[i] > 1E-07f)
						{
							this.targetBeginPosEnabled[i] |= FullBodyIK.BodyIK.SolverInternal.Limb._SolveTargetBeginPos(ref this.targetBeginPos[i], ref this.bendingPos[i], ref this._beginToBendingLength[i], this._bendingPull[i]);
						}
						return this.targetBeginPosEnabled[i];
					}

					// Token: 0x06000809 RID: 2057 RVA: 0x00049E40 File Offset: 0x00048040
					private static bool _SolveTargetBeginPos(ref Vector3 targetBeginPos, ref Vector3 targetEndPos, ref FullBodyIK.FastLength targetBeginToEndLength, float endPull)
					{
						Vector3 a = targetEndPos - targetBeginPos;
						float sqrMagnitude = a.sqrMagnitude;
						if (sqrMagnitude > targetBeginToEndLength.lengthSq + 1E-45f)
						{
							float num = FullBodyIK.SAFBIKSqrt(sqrMagnitude);
							if (num > 1E-07f)
							{
								float num2 = num - targetBeginToEndLength.length;
								num2 /= num;
								if (num2 > 1E-07f)
								{
									if (endPull < 0.9999999f)
									{
										num2 *= endPull;
									}
									targetBeginPos += a * num2;
									return true;
								}
							}
						}
						return false;
					}

					// Token: 0x04000CE3 RID: 3299
					public Vector3[] beginPos;

					// Token: 0x04000CE4 RID: 3300
					public float[] _bendingPull;

					// Token: 0x04000CE5 RID: 3301
					public float[] _endPull;

					// Token: 0x04000CE6 RID: 3302
					public FullBodyIK.FastLength[] _beginToBendingLength;

					// Token: 0x04000CE7 RID: 3303
					public FullBodyIK.FastLength[] _beginToEndLength;

					// Token: 0x04000CE8 RID: 3304
					public bool[] targetBeginPosEnabled = new bool[2];

					// Token: 0x04000CE9 RID: 3305
					public Vector3[] targetBeginPos = new Vector3[2];

					// Token: 0x04000CEA RID: 3306
					public bool[] bendingPosEnabled = new bool[2];

					// Token: 0x04000CEB RID: 3307
					public bool[] endPosEnabled = new bool[2];

					// Token: 0x04000CEC RID: 3308
					public Vector3[] bendingPos = new Vector3[2];

					// Token: 0x04000CED RID: 3309
					public Vector3[] endPos = new Vector3[2];
				}

				// Token: 0x02000191 RID: 401
				public class BackupData
				{
					// Token: 0x04000CEE RID: 3310
					public Vector3 centerArmPos;

					// Token: 0x04000CEF RID: 3311
					public Vector3 centerLegPos;

					// Token: 0x04000CF0 RID: 3312
					public FullBodyIK.Matrix3x3 centerLegBasis;

					// Token: 0x04000CF1 RID: 3313
					public FullBodyIK.Matrix3x3 spineUBasis;

					// Token: 0x04000CF2 RID: 3314
					public Vector3[] spinePos;

					// Token: 0x04000CF3 RID: 3315
					public Vector3 neckPos;

					// Token: 0x04000CF4 RID: 3316
					public Vector3 headPos;

					// Token: 0x04000CF5 RID: 3317
					public Vector3[] shoulderPos;

					// Token: 0x04000CF6 RID: 3318
					public Vector3[] armPos = new Vector3[2];

					// Token: 0x04000CF7 RID: 3319
					public Vector3[] legPos = new Vector3[2];
				}

				// Token: 0x02000192 RID: 402
				private struct _UpperSolverPreArmsTemp
				{
					// Token: 0x0600080B RID: 2059 RVA: 0x00049EF0 File Offset: 0x000480F0
					public static FullBodyIK.BodyIK.SolverInternal._UpperSolverPreArmsTemp Alloc()
					{
						return new FullBodyIK.BodyIK.SolverInternal._UpperSolverPreArmsTemp
						{
							shoulderPos = new Vector3[2],
							armPos = new Vector3[2],
							nearArmPos = null,
							shoulderEnabled = false
						};
					}

					// Token: 0x04000CF8 RID: 3320
					public Vector3[] shoulderPos;

					// Token: 0x04000CF9 RID: 3321
					public Vector3[] armPos;

					// Token: 0x04000CFA RID: 3322
					public Vector3[] nearArmPos;

					// Token: 0x04000CFB RID: 3323
					public Vector3 neckPos;

					// Token: 0x04000CFC RID: 3324
					public bool shoulderEnabled;
				}

				// Token: 0x02000193 RID: 403
				private struct _UpperSolverArmsTemp
				{
					// Token: 0x0600080C RID: 2060 RVA: 0x00049F30 File Offset: 0x00048130
					public static FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp Alloc()
					{
						return new FullBodyIK.BodyIK.SolverInternal._UpperSolverArmsTemp
						{
							shoulderPos = new Vector3[2],
							armPos = new Vector3[2],
							nearArmPos = null,
							shoulderEnabled = false,
							centerArmPos = Vector3.zero,
							centerArmDir = Vector3.zero
						};
					}

					// Token: 0x04000CFD RID: 3325
					public Vector3[] shoulderPos;

					// Token: 0x04000CFE RID: 3326
					public Vector3[] armPos;

					// Token: 0x04000CFF RID: 3327
					public Vector3[] nearArmPos;

					// Token: 0x04000D00 RID: 3328
					public bool shoulderEnabled;

					// Token: 0x04000D01 RID: 3329
					public Vector3 centerArmPos;

					// Token: 0x04000D02 RID: 3330
					public Vector3 centerArmDir;
				}

				// Token: 0x02000194 RID: 404
				private struct _UpperSolverTemp
				{
					// Token: 0x0600080D RID: 2061 RVA: 0x00049F88 File Offset: 0x00048188
					public static FullBodyIK.BodyIK.SolverInternal._UpperSolverTemp Alloc()
					{
						return new FullBodyIK.BodyIK.SolverInternal._UpperSolverTemp
						{
							targetArmPos = new Vector3[2],
							targetNeckPos = default(Vector3),
							targetHeadPos = default(Vector3),
							wristToArmRate = new float[2],
							neckToWristRate = new float[2]
						};
					}

					// Token: 0x04000D03 RID: 3331
					public Vector3[] targetArmPos;

					// Token: 0x04000D04 RID: 3332
					public Vector3 targetNeckPos;

					// Token: 0x04000D05 RID: 3333
					public Vector3 targetHeadPos;

					// Token: 0x04000D06 RID: 3334
					public float[] wristToArmRate;

					// Token: 0x04000D07 RID: 3335
					public float[] neckToWristRate;
				}
			}
		}

		// Token: 0x02000195 RID: 405
		public enum _LocalAxisFrom
		{
			// Token: 0x04000D09 RID: 3337
			None,
			// Token: 0x04000D0A RID: 3338
			Parent,
			// Token: 0x04000D0B RID: 3339
			Child,
			// Token: 0x04000D0C RID: 3340
			Max,
			// Token: 0x04000D0D RID: 3341
			Unknown = 3
		}

		// Token: 0x02000196 RID: 406
		[Serializable]
		public class Bone
		{
			// Token: 0x17000115 RID: 277
			// (get) Token: 0x0600080F RID: 2063 RVA: 0x0004A12B File Offset: 0x0004832B
			public FullBodyIK.BoneLocation boneLocation
			{
				get
				{
					return this._boneLocation;
				}
			}

			// Token: 0x17000116 RID: 278
			// (get) Token: 0x06000810 RID: 2064 RVA: 0x0004A133 File Offset: 0x00048333
			public FullBodyIK.BoneType boneType
			{
				get
				{
					return this._boneType;
				}
			}

			// Token: 0x17000117 RID: 279
			// (get) Token: 0x06000811 RID: 2065 RVA: 0x0004A13B File Offset: 0x0004833B
			public FullBodyIK.Side boneSide
			{
				get
				{
					return this._boneSide;
				}
			}

			// Token: 0x17000118 RID: 280
			// (get) Token: 0x06000812 RID: 2066 RVA: 0x0004A143 File Offset: 0x00048343
			public FullBodyIK.FingerType fingerType
			{
				get
				{
					return this._fingerType;
				}
			}

			// Token: 0x17000119 RID: 281
			// (get) Token: 0x06000813 RID: 2067 RVA: 0x0004A14B File Offset: 0x0004834B
			public int fingerIndex
			{
				get
				{
					return this._fingerIndex;
				}
			}

			// Token: 0x1700011A RID: 282
			// (get) Token: 0x06000814 RID: 2068 RVA: 0x0004A153 File Offset: 0x00048353
			public FullBodyIK._LocalAxisFrom localAxisFrom
			{
				get
				{
					return this._localAxisFrom;
				}
			}

			// Token: 0x1700011B RID: 283
			// (get) Token: 0x06000815 RID: 2069 RVA: 0x0004A15B File Offset: 0x0004835B
			public FullBodyIK._DirectionAs localDirectionAs
			{
				get
				{
					return this._localDirectionAs;
				}
			}

			// Token: 0x1700011C RID: 284
			// (get) Token: 0x06000816 RID: 2070 RVA: 0x0004A163 File Offset: 0x00048363
			public FullBodyIK.Bone parentBone
			{
				get
				{
					return this._parentBone;
				}
			}

			// Token: 0x1700011D RID: 285
			// (get) Token: 0x06000817 RID: 2071 RVA: 0x0004A16B File Offset: 0x0004836B
			public FullBodyIK.Bone parentBoneLocationBased
			{
				get
				{
					return this._parentBoneLocationBased;
				}
			}

			// Token: 0x1700011E RID: 286
			// (get) Token: 0x06000818 RID: 2072 RVA: 0x0004A173 File Offset: 0x00048373
			public bool isWritebackWorldPosition
			{
				get
				{
					return this._isWritebackWorldPosition;
				}
			}

			// Token: 0x1700011F RID: 287
			// (get) Token: 0x06000819 RID: 2073 RVA: 0x0004A17B File Offset: 0x0004837B
			public string name
			{
				get
				{
					return this._boneType.ToString();
				}
			}

			// Token: 0x17000120 RID: 288
			// (get) Token: 0x0600081A RID: 2074 RVA: 0x0004A18E File Offset: 0x0004838E
			public bool transformIsAlive
			{
				get
				{
					if (this._transformIsAlive == -1)
					{
						this._transformIsAlive = ((!FullBodyIK.CheckAlive<Transform>(ref this.transform)) ? 0 : 1);
					}
					return this._transformIsAlive != 0;
				}
			}

			// Token: 0x17000121 RID: 289
			// (get) Token: 0x0600081B RID: 2075 RVA: 0x0004A1C5 File Offset: 0x000483C5
			public Transform parentTransform
			{
				get
				{
					if (this._parentBone != null)
					{
						return this._parentBone.transform;
					}
					return null;
				}
			}

			// Token: 0x0600081C RID: 2076 RVA: 0x0004A1E0 File Offset: 0x000483E0
			public static FullBodyIK.Bone Preset(FullBodyIK.BoneLocation boneLocation)
			{
				FullBodyIK.Bone bone = new FullBodyIK.Bone();
				bone._PresetBoneLocation(boneLocation);
				return bone;
			}

			// Token: 0x0600081D RID: 2077 RVA: 0x0004A1FC File Offset: 0x000483FC
			private void _PresetBoneLocation(FullBodyIK.BoneLocation boneLocation)
			{
				this._isPresetted = true;
				this._boneLocation = boneLocation;
				this._boneType = FullBodyIK.ToBoneType(boneLocation);
				this._boneSide = FullBodyIK.ToBoneSide(boneLocation);
				if (this._boneType == FullBodyIK.BoneType.HandFinger)
				{
					this._fingerType = FullBodyIK.ToFingerType(boneLocation);
					this._fingerIndex = FullBodyIK.ToFingerIndex(boneLocation);
				}
				else
				{
					this._fingerType = FullBodyIK.FingerType.Max;
					this._fingerIndex = -1;
				}
				this._PresetLocalAxis();
			}

			// Token: 0x0600081E RID: 2078 RVA: 0x0004A270 File Offset: 0x00048470
			private void _PresetLocalAxis()
			{
				switch (this._boneType)
				{
				case FullBodyIK.BoneType.Hips:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Child, FullBodyIK._DirectionAs.YPlus);
					return;
				case FullBodyIK.BoneType.Spine:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Child, FullBodyIK._DirectionAs.YPlus);
					return;
				case FullBodyIK.BoneType.Neck:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Child, FullBodyIK._DirectionAs.YPlus);
					return;
				case FullBodyIK.BoneType.Head:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.None, FullBodyIK._DirectionAs.None);
					return;
				case FullBodyIK.BoneType.Eye:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.None, FullBodyIK._DirectionAs.None);
					return;
				case FullBodyIK.BoneType.Leg:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Child, FullBodyIK._DirectionAs.YMinus);
					return;
				case FullBodyIK.BoneType.Knee:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Child, FullBodyIK._DirectionAs.YMinus);
					return;
				case FullBodyIK.BoneType.Foot:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Parent, FullBodyIK._DirectionAs.YMinus);
					return;
				case FullBodyIK.BoneType.Shoulder:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Child, (this._boneSide != FullBodyIK.Side.Left) ? FullBodyIK._DirectionAs.XPlus : FullBodyIK._DirectionAs.XMinus);
					return;
				case FullBodyIK.BoneType.Arm:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Child, (this._boneSide != FullBodyIK.Side.Left) ? FullBodyIK._DirectionAs.XPlus : FullBodyIK._DirectionAs.XMinus);
					return;
				case FullBodyIK.BoneType.ArmRoll:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Parent, (this._boneSide != FullBodyIK.Side.Left) ? FullBodyIK._DirectionAs.XPlus : FullBodyIK._DirectionAs.XMinus);
					return;
				case FullBodyIK.BoneType.Elbow:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Child, (this._boneSide != FullBodyIK.Side.Left) ? FullBodyIK._DirectionAs.XPlus : FullBodyIK._DirectionAs.XMinus);
					return;
				case FullBodyIK.BoneType.ElbowRoll:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Parent, (this._boneSide != FullBodyIK.Side.Left) ? FullBodyIK._DirectionAs.XPlus : FullBodyIK._DirectionAs.XMinus);
					return;
				case FullBodyIK.BoneType.Wrist:
					this._PresetLocalAxis(FullBodyIK._LocalAxisFrom.Parent, (this._boneSide != FullBodyIK.Side.Left) ? FullBodyIK._DirectionAs.XPlus : FullBodyIK._DirectionAs.XMinus);
					return;
				default:
					if (this._boneType == FullBodyIK.BoneType.HandFinger)
					{
						FullBodyIK._LocalAxisFrom localAxisFrom = (this._fingerIndex + 1 != 4) ? FullBodyIK._LocalAxisFrom.Child : FullBodyIK._LocalAxisFrom.Parent;
						this._PresetLocalAxis(localAxisFrom, (this._boneSide != FullBodyIK.Side.Left) ? FullBodyIK._DirectionAs.XPlus : FullBodyIK._DirectionAs.XMinus);
						return;
					}
					return;
				}
			}

			// Token: 0x0600081F RID: 2079 RVA: 0x0004A3E8 File Offset: 0x000485E8
			private void _PresetLocalAxis(FullBodyIK._LocalAxisFrom localAxisFrom, FullBodyIK._DirectionAs localDirectionAs)
			{
				this._localAxisFrom = localAxisFrom;
				this._localDirectionAs = localDirectionAs;
			}

			// Token: 0x06000820 RID: 2080 RVA: 0x0004A3F8 File Offset: 0x000485F8
			public static void Prefix(FullBodyIK.Bone[] bones, ref FullBodyIK.Bone bone, FullBodyIK.BoneLocation boneLocation, FullBodyIK.Bone parentBoneLocationBased = null)
			{
				if (bone == null)
				{
					bone = new FullBodyIK.Bone();
				}
				if (!bone._isPresetted || bone._boneLocation != boneLocation || bone._boneType < FullBodyIK.BoneType.Hips || bone._boneType >= FullBodyIK.BoneType.Max || bone._localAxisFrom == FullBodyIK._LocalAxisFrom.Max || bone._localDirectionAs == FullBodyIK._DirectionAs.Max)
				{
					bone._PresetBoneLocation(boneLocation);
				}
				bone._parentBoneLocationBased = parentBoneLocationBased;
				if (bones != null)
				{
					bones[(int)boneLocation] = bone;
				}
			}

			// Token: 0x06000821 RID: 2081 RVA: 0x0004A47C File Offset: 0x0004867C
			public void Prepare(FullBodyIK fullBodyIK)
			{
				this._transformIsAlive = -1;
				this._localAxisBasis = FullBodyIK.Matrix3x3.identity;
				this._isWritebackWorldPosition = false;
				this._parentBone = null;
				if (this.transformIsAlive)
				{
					for (FullBodyIK.Bone parentBoneLocationBased = this._parentBoneLocationBased; parentBoneLocationBased != null; parentBoneLocationBased = parentBoneLocationBased._parentBoneLocationBased)
					{
						if (parentBoneLocationBased.transformIsAlive)
						{
							this._parentBone = parentBoneLocationBased;
							break;
						}
					}
				}
				if (this._boneLocation == FullBodyIK.BoneLocation.Hips)
				{
					if (this.transformIsAlive)
					{
						this._isWritebackWorldPosition = true;
					}
				}
				else if (this._boneLocation == FullBodyIK.BoneLocation.Spine && this.transformIsAlive && this._parentBone != null && this._parentBone.transformIsAlive && FullBodyIK.IsParentOfRecusively(this._parentBone.transform, this.transform))
				{
					this._isWritebackWorldPosition = true;
				}
				if (this._boneType == FullBodyIK.BoneType.Eye && fullBodyIK._IsHiddenCustomEyes())
				{
					this._isWritebackWorldPosition = true;
				}
				if (this.transformIsAlive)
				{
					this._defaultPosition = this.transform.position;
					this._defaultRotation = this.transform.rotation;
					FullBodyIK.SAFBIKMatSetRot(out this._defaultBasis, ref this._defaultRotation);
					if (this._parentBone != null)
					{
						this._defaultLocalTranslate = this._defaultPosition - this._parentBone._defaultPosition;
						this._defaultLocalLength = FullBodyIK.FastLength.FromVector3(ref this._defaultLocalTranslate);
						if (this._defaultLocalLength.length > 1E-45f)
						{
							float num = 1f / this._defaultLocalLength.length;
							this._defaultLocalDirection.x = this._defaultLocalTranslate.x * num;
							this._defaultLocalDirection.y = this._defaultLocalTranslate.y * num;
							this._defaultLocalDirection.z = this._defaultLocalTranslate.z * num;
						}
					}
					FullBodyIK.SAFBIKMatMultInv0(out this._worldToBaseBasis, ref this._defaultBasis, ref fullBodyIK.internalValues.defaultRootBasis);
					this._baseToWorldBasis = this._worldToBaseBasis.transpose;
					FullBodyIK.SAFBIKMatGetRot(out this._worldToBaseRotation, ref this._worldToBaseBasis);
					this._baseToWorldRotation = FullBodyIK.Inverse(this._worldToBaseRotation);
				}
				else
				{
					this._defaultPosition = Vector3.zero;
					this._defaultRotation = Quaternion.identity;
					this._defaultBasis = FullBodyIK.Matrix3x3.identity;
					this._defaultLocalTranslate = Vector3.zero;
					this._defaultLocalLength = default(FullBodyIK.FastLength);
					this._defaultLocalDirection = Vector3.zero;
					this._worldToBaseBasis = FullBodyIK.Matrix3x3.identity;
					this._baseToWorldBasis = FullBodyIK.Matrix3x3.identity;
					this._worldToBaseRotation = Quaternion.identity;
					this._baseToWorldRotation = Quaternion.identity;
				}
				this._ComputeLocalAxis(fullBodyIK);
			}

			// Token: 0x06000822 RID: 2082 RVA: 0x0004A72C File Offset: 0x0004892C
			private void _ComputeLocalAxis(FullBodyIK fullBodyIK)
			{
				if (this.transformIsAlive && this._parentBone != null && this._parentBone.transformIsAlive && (this._localAxisFrom == FullBodyIK._LocalAxisFrom.Parent || this._parentBone._localAxisFrom == FullBodyIK._LocalAxisFrom.Child))
				{
					Vector3 defaultLocalDirection = this._defaultLocalDirection;
					if (defaultLocalDirection.x != 0f || defaultLocalDirection.y != 0f || defaultLocalDirection.z != 0f)
					{
						if (this._localAxisFrom == FullBodyIK._LocalAxisFrom.Parent)
						{
							FullBodyIK.SAFBIKComputeBasisFrom(out this._localAxisBasis, ref fullBodyIK.internalValues.defaultRootBasis, ref defaultLocalDirection, this._localDirectionAs);
						}
						if (this._parentBone._localAxisFrom == FullBodyIK._LocalAxisFrom.Child)
						{
							if (this._parentBone._boneType == FullBodyIK.BoneType.Shoulder)
							{
								FullBodyIK.Bone parentBone = this._parentBone;
								FullBodyIK.Bone parentBone2 = this._parentBone._parentBone;
								FullBodyIK.Bone bone = (fullBodyIK.headBones == null) ? null : fullBodyIK.headBones.neck;
								if (bone != null && !bone.transformIsAlive)
								{
									bone = null;
								}
								if (fullBodyIK.internalValues.shoulderDirYAsNeck == -1)
								{
									if (fullBodyIK.settings.shoulderDirYAsNeck == FullBodyIK.AutomaticBool.Auto)
									{
										if (parentBone2 != null && bone != null)
										{
											Vector3 defaultLocalDirection2 = parentBone._defaultLocalDirection;
											Vector3 rhs = bone._defaultPosition - parentBone._defaultPosition;
											if (FullBodyIK.SAFBIKVecNormalize(ref rhs))
											{
												float num = Mathf.Abs(Vector3.Dot(defaultLocalDirection, defaultLocalDirection2));
												float num2 = Mathf.Abs(Vector3.Dot(defaultLocalDirection, rhs));
												if (num < num2)
												{
													fullBodyIK.internalValues.shoulderDirYAsNeck = 0;
												}
												else
												{
													fullBodyIK.internalValues.shoulderDirYAsNeck = 1;
												}
											}
											else
											{
												fullBodyIK.internalValues.shoulderDirYAsNeck = 0;
											}
										}
										else
										{
											fullBodyIK.internalValues.shoulderDirYAsNeck = 0;
										}
									}
									else
									{
										fullBodyIK.internalValues.shoulderDirYAsNeck = ((fullBodyIK.settings.shoulderDirYAsNeck == FullBodyIK.AutomaticBool.Disable) ? 0 : 1);
									}
								}
								Vector3 vector = (this._parentBone._localDirectionAs != FullBodyIK._DirectionAs.XMinus) ? defaultLocalDirection : (-defaultLocalDirection);
								Vector3 rhs2;
								if (fullBodyIK.internalValues.shoulderDirYAsNeck != 0 && bone != null)
								{
									rhs2 = bone._defaultPosition - parentBone._defaultPosition;
								}
								else
								{
									rhs2 = parentBone._defaultLocalDirection;
								}
								Vector3 lhs = Vector3.Cross(vector, rhs2);
								rhs2 = Vector3.Cross(lhs, vector);
								if (FullBodyIK.SAFBIKVecNormalize2(ref rhs2, ref lhs))
								{
									this._parentBone._localAxisBasis.SetColumn(ref vector, ref rhs2, ref lhs);
								}
							}
							else if (this._parentBone._boneType != FullBodyIK.BoneType.Spine || this._boneType == FullBodyIK.BoneType.Spine || this._boneType == FullBodyIK.BoneType.Neck)
							{
								if (this._parentBone._boneType != FullBodyIK.BoneType.Hips || this._boneType == FullBodyIK.BoneType.Spine)
								{
									if (this._parentBone._boneType == FullBodyIK.BoneType.Hips)
									{
										Vector3 column = fullBodyIK.internalValues.defaultRootBasis.column0;
										FullBodyIK.SAFBIKComputeBasisFromXYLockY(out this._parentBone._localAxisBasis, ref column, ref defaultLocalDirection);
									}
									else if (this._parentBone._boneType == FullBodyIK.BoneType.Spine || this._parentBone._boneType == FullBodyIK.BoneType.Neck)
									{
										if (this._parentBone._parentBone != null)
										{
											Vector3 column2 = this._parentBone._parentBone._localAxisBasis.column0;
											FullBodyIK.SAFBIKComputeBasisFromXYLockY(out this._parentBone._localAxisBasis, ref column2, ref defaultLocalDirection);
										}
									}
									else if (this._localAxisFrom == FullBodyIK._LocalAxisFrom.Parent && this._localDirectionAs == this._parentBone._localDirectionAs)
									{
										this._parentBone._localAxisBasis = this._localAxisBasis;
									}
									else
									{
										FullBodyIK.SAFBIKComputeBasisFrom(out this._parentBone._localAxisBasis, ref fullBodyIK.internalValues.defaultRootBasis, ref defaultLocalDirection, this._parentBone._localDirectionAs);
									}
								}
							}
						}
					}
				}
			}

			// Token: 0x06000823 RID: 2083 RVA: 0x0004AB0C File Offset: 0x00048D0C
			public void PostPrepare()
			{
				if (this._localAxisFrom != FullBodyIK._LocalAxisFrom.None)
				{
					this._localAxisBasisInv = this._localAxisBasis.transpose;
					FullBodyIK.SAFBIKMatGetRot(out this._localAxisRotation, ref this._localAxisBasis);
					this._localAxisRotationInv = FullBodyIK.Inverse(this._localAxisRotation);
					FullBodyIK.SAFBIKMatMultInv0(out this._worldToBoneBasis, ref this._defaultBasis, ref this._localAxisBasis);
					this._boneToWorldBasis = this._worldToBoneBasis.transpose;
					FullBodyIK.SAFBIKMatGetRot(out this._worldToBoneRotation, ref this._worldToBoneBasis);
					this._boneToWorldRotation = FullBodyIK.Inverse(this._worldToBoneRotation);
				}
				else
				{
					this._localAxisBasis = FullBodyIK.Matrix3x3.identity;
					this._localAxisBasisInv = FullBodyIK.Matrix3x3.identity;
					this._localAxisRotation = Quaternion.identity;
					this._localAxisRotationInv = Quaternion.identity;
					this._worldToBoneBasis = this._defaultBasis.transpose;
					this._boneToWorldBasis = this._defaultBasis;
					this._worldToBoneRotation = FullBodyIK.Inverse(this._defaultRotation);
					this._boneToWorldRotation = this._defaultRotation;
				}
				FullBodyIK.SAFBIKMatMultInv0(out this._baseToBoneBasis, ref this._worldToBaseBasis, ref this._worldToBoneBasis);
				this._boneToBaseBasis = this._baseToBoneBasis.transpose;
			}

			// Token: 0x06000824 RID: 2084 RVA: 0x0004AC34 File Offset: 0x00048E34
			public void PrepareUpdate()
			{
				this._transformIsAlive = -1;
				this._isReadWorldPosition = false;
				this._isReadWorldRotation = false;
				this._isWrittenWorldPosition = false;
				this._isWrittenWorldRotation = false;
			}

			// Token: 0x06000825 RID: 2085 RVA: 0x0004AC5C File Offset: 0x00048E5C
			public void SyncDisplacement()
			{
				if (this._parentBone != null && this._parentBone.transformIsAlive && this.transformIsAlive)
				{
					Vector3 vector = this.worldPosition - this._parentBone.worldPosition;
					this._defaultLocalLength = FullBodyIK.FastLength.FromVector3(ref vector);
					if (this._parentBone.transform == this.transform.parent)
					{
						Vector3 localPosition = this.transform.localPosition;
						if (FullBodyIK.SAFBIKVecNormalize(ref localPosition))
						{
							Vector3 vector2;
							FullBodyIK.SAFBIKMatMultVec(out vector2, ref this._parentBone._defaultBasis, ref localPosition);
							this._defaultLocalDirection = vector2;
							this._defaultLocalTranslate = vector2 * this._defaultLocalLength.length;
						}
						else
						{
							this._defaultLocalDirection = Vector3.zero;
							this._defaultLocalTranslate = Vector3.zero;
						}
					}
					else
					{
						this._defaultLocalTranslate = this._defaultLocalDirection * this._defaultLocalLength.length;
					}
				}
			}

			// Token: 0x06000826 RID: 2086 RVA: 0x0004AD5C File Offset: 0x00048F5C
			public void PostSyncDisplacement(FullBodyIK fullBodyIK)
			{
				if (this._boneLocation == FullBodyIK.BoneLocation.Hips)
				{
					this._defaultPosition = fullBodyIK.boneCaches.defaultHipsPosition + fullBodyIK.boneCaches.hipsOffset;
				}
				else if (this._parentBone != null)
				{
					this._defaultPosition = this._parentBone._defaultPosition + this._defaultLocalTranslate;
				}
				this._ComputeLocalAxis(fullBodyIK);
			}

			// Token: 0x17000122 RID: 290
			// (get) Token: 0x06000827 RID: 2087 RVA: 0x0004ADC8 File Offset: 0x00048FC8
			// (set) Token: 0x06000828 RID: 2088 RVA: 0x0004AE14 File Offset: 0x00049014
			public Vector3 worldPosition
			{
				get
				{
					if (!this._isReadWorldPosition && !this._isWrittenWorldPosition)
					{
						this._isReadWorldPosition = true;
						if (this.transformIsAlive)
						{
							this._worldPosition = this.transform.position;
						}
					}
					return this._worldPosition;
				}
				set
				{
					this._isWrittenWorldPosition = true;
					this._worldPosition = value;
				}
			}

			// Token: 0x17000123 RID: 291
			// (get) Token: 0x06000829 RID: 2089 RVA: 0x0004AE24 File Offset: 0x00049024
			// (set) Token: 0x0600082A RID: 2090 RVA: 0x0004AE70 File Offset: 0x00049070
			public Quaternion worldRotation
			{
				get
				{
					if (!this._isReadWorldRotation && !this._isWrittenWorldRotation)
					{
						this._isReadWorldRotation = true;
						if (this.transformIsAlive)
						{
							this._worldRotation = this.transform.rotation;
						}
					}
					return this._worldRotation;
				}
				set
				{
					this._isWrittenWorldRotation = true;
					this._worldRotation = value;
				}
			}

			// Token: 0x0600082B RID: 2091 RVA: 0x0004AE80 File Offset: 0x00049080
			public void forcefix_worldRotation()
			{
				if (this.transformIsAlive)
				{
					if (!this._isReadWorldRotation)
					{
						this._isReadWorldRotation = true;
						this._worldRotation = this.transform.rotation;
					}
					this._isWrittenWorldRotation = true;
					if (this._parentBone != null && this._parentBone.transformIsAlive)
					{
						Quaternion worldRotation = this._parentBone.worldRotation;
						FullBodyIK.Matrix3x3 matrix3x;
						FullBodyIK.SAFBIKMatSetRotMultInv1(out matrix3x, ref worldRotation, ref this.parentBone._defaultRotation);
						Vector3 worldPosition = this.parentBone.worldPosition;
						Vector3 worldPosition2;
						FullBodyIK.SAFBIKMatMultVecPreSubAdd(out worldPosition2, ref matrix3x, ref this._defaultPosition, ref this.parentBone._defaultPosition, ref worldPosition);
						this._isWrittenWorldPosition = true;
						this._isWritebackWorldPosition = true;
						this._worldPosition = worldPosition2;
					}
				}
			}

			// Token: 0x0600082C RID: 2092 RVA: 0x0004AF3C File Offset: 0x0004913C
			public void WriteToTransform()
			{
				if (this._isWrittenWorldPosition)
				{
					this._isWrittenWorldPosition = false;
					if (this._isWritebackWorldPosition && this.transformIsAlive)
					{
						this.transform.position = this._worldPosition;
					}
				}
				if (this._isWrittenWorldRotation)
				{
					this._isWrittenWorldRotation = false;
					if (this.transformIsAlive)
					{
						this.transform.rotation = this._worldRotation;
					}
				}
			}

			// Token: 0x04000D0E RID: 3342
			public Transform transform;

			// Token: 0x04000D0F RID: 3343
			[SerializeField]
			private bool _isPresetted;

			// Token: 0x04000D10 RID: 3344
			[SerializeField]
			private FullBodyIK.BoneLocation _boneLocation = FullBodyIK.BoneLocation.Max;

			// Token: 0x04000D11 RID: 3345
			[SerializeField]
			private FullBodyIK.BoneType _boneType = FullBodyIK.BoneType.Max;

			// Token: 0x04000D12 RID: 3346
			[SerializeField]
			private FullBodyIK.Side _boneSide = FullBodyIK.Side.Max;

			// Token: 0x04000D13 RID: 3347
			[SerializeField]
			private FullBodyIK.FingerType _fingerType = FullBodyIK.FingerType.Max;

			// Token: 0x04000D14 RID: 3348
			[SerializeField]
			private int _fingerIndex = -1;

			// Token: 0x04000D15 RID: 3349
			[SerializeField]
			private FullBodyIK._LocalAxisFrom _localAxisFrom = FullBodyIK._LocalAxisFrom.Max;

			// Token: 0x04000D16 RID: 3350
			[SerializeField]
			private FullBodyIK._DirectionAs _localDirectionAs = FullBodyIK._DirectionAs.Max;

			// Token: 0x04000D17 RID: 3351
			private FullBodyIK.Bone _parentBone;

			// Token: 0x04000D18 RID: 3352
			private FullBodyIK.Bone _parentBoneLocationBased;

			// Token: 0x04000D19 RID: 3353
			public Vector3 _defaultPosition = Vector3.zero;

			// Token: 0x04000D1A RID: 3354
			public Quaternion _defaultRotation = Quaternion.identity;

			// Token: 0x04000D1B RID: 3355
			public FullBodyIK.Matrix3x3 _defaultBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D1C RID: 3356
			public Vector3 _defaultLocalTranslate = Vector3.zero;

			// Token: 0x04000D1D RID: 3357
			public Vector3 _defaultLocalDirection = Vector3.zero;

			// Token: 0x04000D1E RID: 3358
			public FullBodyIK.FastLength _defaultLocalLength = default(FullBodyIK.FastLength);

			// Token: 0x04000D1F RID: 3359
			public FullBodyIK.Matrix3x3 _localAxisBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D20 RID: 3360
			public FullBodyIK.Matrix3x3 _localAxisBasisInv = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D21 RID: 3361
			public Quaternion _localAxisRotation = Quaternion.identity;

			// Token: 0x04000D22 RID: 3362
			public Quaternion _localAxisRotationInv = Quaternion.identity;

			// Token: 0x04000D23 RID: 3363
			public FullBodyIK.Matrix3x3 _worldToBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D24 RID: 3364
			public FullBodyIK.Matrix3x3 _boneToWorldBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D25 RID: 3365
			public FullBodyIK.Matrix3x3 _worldToBaseBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D26 RID: 3366
			public FullBodyIK.Matrix3x3 _baseToWorldBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D27 RID: 3367
			public Quaternion _worldToBoneRotation = Quaternion.identity;

			// Token: 0x04000D28 RID: 3368
			public Quaternion _boneToWorldRotation = Quaternion.identity;

			// Token: 0x04000D29 RID: 3369
			public Quaternion _worldToBaseRotation = Quaternion.identity;

			// Token: 0x04000D2A RID: 3370
			public Quaternion _baseToWorldRotation = Quaternion.identity;

			// Token: 0x04000D2B RID: 3371
			public FullBodyIK.Matrix3x3 _baseToBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D2C RID: 3372
			public FullBodyIK.Matrix3x3 _boneToBaseBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000D2D RID: 3373
			[SerializeField]
			private bool _isWritebackWorldPosition;

			// Token: 0x04000D2E RID: 3374
			[NonSerialized]
			public Vector3 _worldPosition = Vector3.zero;

			// Token: 0x04000D2F RID: 3375
			[NonSerialized]
			public Quaternion _worldRotation = Quaternion.identity;

			// Token: 0x04000D30 RID: 3376
			private bool _isReadWorldPosition;

			// Token: 0x04000D31 RID: 3377
			private bool _isReadWorldRotation;

			// Token: 0x04000D32 RID: 3378
			private bool _isWrittenWorldPosition;

			// Token: 0x04000D33 RID: 3379
			private bool _isWrittenWorldRotation;

			// Token: 0x04000D34 RID: 3380
			private int _transformIsAlive = -1;
		}

		// Token: 0x02000197 RID: 407
		[Serializable]
		public class Effector
		{
			// Token: 0x17000124 RID: 292
			// (get) Token: 0x0600082E RID: 2094 RVA: 0x0004B027 File Offset: 0x00049227
			public bool effectorEnabled
			{
				get
				{
					return this.positionEnabled || (this.rotationContained && this.rotationContained);
				}
			}

			// Token: 0x17000125 RID: 293
			// (get) Token: 0x0600082F RID: 2095 RVA: 0x0004B04B File Offset: 0x0004924B
			public bool rotationContained
			{
				get
				{
					return (this._effectorFlags & FullBodyIK.Effector._EffectorFlags.RotationContained) != FullBodyIK.Effector._EffectorFlags.None;
				}
			}

			// Token: 0x17000126 RID: 294
			// (get) Token: 0x06000830 RID: 2096 RVA: 0x0004B05B File Offset: 0x0004925B
			public bool pullContained
			{
				get
				{
					return (this._effectorFlags & FullBodyIK.Effector._EffectorFlags.PullContained) != FullBodyIK.Effector._EffectorFlags.None;
				}
			}

			// Token: 0x17000127 RID: 295
			// (get) Token: 0x06000831 RID: 2097 RVA: 0x0004B06B File Offset: 0x0004926B
			public FullBodyIK.EffectorLocation effectorLocation
			{
				get
				{
					return this._effectorLocation;
				}
			}

			// Token: 0x17000128 RID: 296
			// (get) Token: 0x06000832 RID: 2098 RVA: 0x0004B073 File Offset: 0x00049273
			public FullBodyIK.EffectorType effectorType
			{
				get
				{
					return this._effectorType;
				}
			}

			// Token: 0x17000129 RID: 297
			// (get) Token: 0x06000833 RID: 2099 RVA: 0x0004B07B File Offset: 0x0004927B
			public FullBodyIK.Effector parentEffector
			{
				get
				{
					return this._parentEffector;
				}
			}

			// Token: 0x1700012A RID: 298
			// (get) Token: 0x06000834 RID: 2100 RVA: 0x0004B083 File Offset: 0x00049283
			public FullBodyIK.Bone bone
			{
				get
				{
					return this._bone;
				}
			}

			// Token: 0x1700012B RID: 299
			// (get) Token: 0x06000835 RID: 2101 RVA: 0x0004B08B File Offset: 0x0004928B
			public FullBodyIK.Bone leftBone
			{
				get
				{
					return this._leftBone;
				}
			}

			// Token: 0x1700012C RID: 300
			// (get) Token: 0x06000836 RID: 2102 RVA: 0x0004B093 File Offset: 0x00049293
			public FullBodyIK.Bone rightBone
			{
				get
				{
					return this._rightBone;
				}
			}

			// Token: 0x1700012D RID: 301
			// (get) Token: 0x06000837 RID: 2103 RVA: 0x0004B09B File Offset: 0x0004929B
			public Vector3 defaultPosition
			{
				get
				{
					return this._defaultPosition;
				}
			}

			// Token: 0x1700012E RID: 302
			// (get) Token: 0x06000838 RID: 2104 RVA: 0x0004B0A3 File Offset: 0x000492A3
			public Quaternion defaultRotation
			{
				get
				{
					return this._defaultRotation;
				}
			}

			// Token: 0x1700012F RID: 303
			// (get) Token: 0x06000839 RID: 2105 RVA: 0x0004B0AB File Offset: 0x000492AB
			public string name
			{
				get
				{
					return FullBodyIK.GetEffectorName(this._effectorLocation);
				}
			}

			// Token: 0x17000130 RID: 304
			// (get) Token: 0x0600083A RID: 2106 RVA: 0x0004B0B8 File Offset: 0x000492B8
			public bool transformIsAlive
			{
				get
				{
					if (this._transformIsAlive == -1)
					{
						this._transformIsAlive = ((!FullBodyIK.CheckAlive<Transform>(ref this.transform)) ? 0 : 1);
					}
					return this._transformIsAlive != 0;
				}
			}

			// Token: 0x17000131 RID: 305
			// (get) Token: 0x0600083B RID: 2107 RVA: 0x0004B0EF File Offset: 0x000492EF
			private bool _defaultLocalBasisIsIdentity
			{
				get
				{
					return (this._effectorFlags & FullBodyIK.Effector._EffectorFlags.RotationContained) == FullBodyIK.Effector._EffectorFlags.None || this._bone == null || this._bone.localAxisFrom == FullBodyIK._LocalAxisFrom.None || this._bone.boneType == FullBodyIK.BoneType.Hips;
				}
			}

			// Token: 0x0600083C RID: 2108 RVA: 0x0004B12C File Offset: 0x0004932C
			public void Prefix()
			{
				this.positionEnabled = FullBodyIK.Effector._GetPresetPositionEnabled(this._effectorType);
				this.positionWeight = FullBodyIK.Effector._GetPresetPositionWeight(this._effectorType);
				this.pull = FullBodyIK.Effector._GetPresetPull(this._effectorType);
			}

			// Token: 0x0600083D RID: 2109 RVA: 0x0004B161 File Offset: 0x00049361
			private void _PresetEffectorLocation(FullBodyIK.EffectorLocation effectorLocation)
			{
				this._isPresetted = true;
				this._effectorLocation = effectorLocation;
				this._effectorType = FullBodyIK.ToEffectorType(effectorLocation);
				this._effectorFlags = FullBodyIK.Effector._GetEffectorFlags(this._effectorType);
			}

			// Token: 0x0600083E RID: 2110 RVA: 0x0004B190 File Offset: 0x00049390
			public static void Prefix(FullBodyIK.Effector[] effectors, ref FullBodyIK.Effector effector, FullBodyIK.EffectorLocation effectorLocation, bool createEffectorTransform, Transform parentTransform, FullBodyIK.Effector parentEffector = null, FullBodyIK.Bone bone = null, FullBodyIK.Bone leftBone = null, FullBodyIK.Bone rightBone = null)
			{
				if (effector == null)
				{
					effector = new FullBodyIK.Effector();
				}
				if (!effector._isPresetted || effector._effectorLocation != effectorLocation || effector._effectorType < FullBodyIK.EffectorType.Root || effector._effectorType >= FullBodyIK.EffectorType.Max)
				{
					effector._PresetEffectorLocation(effectorLocation);
				}
				effector._parentEffector = parentEffector;
				effector._bone = bone;
				effector._leftBone = leftBone;
				effector._rightBone = rightBone;
				effector._PrefixTransform(createEffectorTransform, parentTransform);
				if (effectors != null)
				{
					effectors[(int)effectorLocation] = effector;
				}
			}

			// Token: 0x0600083F RID: 2111 RVA: 0x0004B220 File Offset: 0x00049420
			private static bool _GetPresetPositionEnabled(FullBodyIK.EffectorType effectorType)
			{
				return effectorType == FullBodyIK.EffectorType.Wrist || effectorType == FullBodyIK.EffectorType.Foot;
			}

			// Token: 0x06000840 RID: 2112 RVA: 0x0004B23B File Offset: 0x0004943B
			private static float _GetPresetPositionWeight(FullBodyIK.EffectorType effectorType)
			{
				if (effectorType != FullBodyIK.EffectorType.Arm)
				{
					return 1f;
				}
				return 0f;
			}

			// Token: 0x06000841 RID: 2113 RVA: 0x0004B254 File Offset: 0x00049454
			private static float _GetPresetPull(FullBodyIK.EffectorType effectorType)
			{
				switch (effectorType)
				{
				case FullBodyIK.EffectorType.Hips:
					return 1f;
				case FullBodyIK.EffectorType.Eyes:
					return 1f;
				case FullBodyIK.EffectorType.Foot:
					return 1f;
				case FullBodyIK.EffectorType.Arm:
					return 1f;
				case FullBodyIK.EffectorType.Wrist:
					return 1f;
				}
				return 0f;
			}

			// Token: 0x06000842 RID: 2114 RVA: 0x0004B2B8 File Offset: 0x000494B8
			private static FullBodyIK.Effector._EffectorFlags _GetEffectorFlags(FullBodyIK.EffectorType effectorType)
			{
				switch (effectorType)
				{
				case FullBodyIK.EffectorType.Hips:
					return FullBodyIK.Effector._EffectorFlags.RotationContained | FullBodyIK.Effector._EffectorFlags.PullContained;
				case FullBodyIK.EffectorType.Neck:
					return FullBodyIK.Effector._EffectorFlags.PullContained;
				case FullBodyIK.EffectorType.Head:
					return FullBodyIK.Effector._EffectorFlags.RotationContained | FullBodyIK.Effector._EffectorFlags.PullContained;
				case FullBodyIK.EffectorType.Eyes:
					return FullBodyIK.Effector._EffectorFlags.PullContained;
				case FullBodyIK.EffectorType.Knee:
					return FullBodyIK.Effector._EffectorFlags.PullContained;
				case FullBodyIK.EffectorType.Foot:
					return FullBodyIK.Effector._EffectorFlags.RotationContained | FullBodyIK.Effector._EffectorFlags.PullContained;
				case FullBodyIK.EffectorType.Arm:
					return FullBodyIK.Effector._EffectorFlags.PullContained;
				case FullBodyIK.EffectorType.Elbow:
					return FullBodyIK.Effector._EffectorFlags.PullContained;
				case FullBodyIK.EffectorType.Wrist:
					return FullBodyIK.Effector._EffectorFlags.RotationContained | FullBodyIK.Effector._EffectorFlags.PullContained;
				default:
					return FullBodyIK.Effector._EffectorFlags.None;
				}
			}

			// Token: 0x06000843 RID: 2115 RVA: 0x0004B30C File Offset: 0x0004950C
			private void _PrefixTransform(bool createEffectorTransform, Transform parentTransform)
			{
				if (createEffectorTransform)
				{
					if (this.transform == null || this.transform != this._createdTransform)
					{
						if (this.transform == null)
						{
							GameObject gameObject = new GameObject(FullBodyIK.GetEffectorName(this._effectorLocation));
							if (parentTransform != null)
							{
								gameObject.transform.SetParent(parentTransform, false);
							}
							else if (this._parentEffector != null && this._parentEffector.transformIsAlive)
							{
								gameObject.transform.SetParent(this._parentEffector.transform, false);
							}
							this.transform = gameObject.transform;
							this._createdTransform = gameObject.transform;
						}
						else
						{
							FullBodyIK.DestroyImmediate(ref this._createdTransform, true);
						}
					}
					else
					{
						FullBodyIK.CheckAlive<Transform>(ref this._createdTransform);
					}
				}
				else
				{
					if (this._createdTransform != null)
					{
						if (this.transform == this._createdTransform)
						{
							this.transform = null;
						}
						UnityEngine.Object.DestroyImmediate(this._createdTransform.gameObject, true);
					}
					this._createdTransform = null;
				}
				this._transformIsAlive = ((!FullBodyIK.CheckAlive<Transform>(ref this.transform)) ? 0 : 1);
			}

			// Token: 0x06000844 RID: 2116 RVA: 0x0004B45C File Offset: 0x0004965C
			public void Prepare(FullBodyIK fullBodyIK)
			{
				this._ClearInternal();
				this._ComputeDefaultTransform(fullBodyIK);
				if (this.transformIsAlive)
				{
					if (this._effectorType == FullBodyIK.EffectorType.Eyes)
					{
						this.transform.position = this._defaultPosition + fullBodyIK.internalValues.defaultRootBasis.column2 * 1f;
					}
					else
					{
						this.transform.position = this._defaultPosition;
					}
					if (!this._defaultLocalBasisIsIdentity)
					{
						this.transform.rotation = this._defaultRotation;
					}
					else
					{
						this.transform.localRotation = Quaternion.identity;
					}
					this.transform.localScale = Vector3.one;
				}
				this._worldPosition = this._defaultPosition;
				this._worldRotation = this._defaultRotation;
				if (this._effectorType == FullBodyIK.EffectorType.Eyes)
				{
					this._worldPosition += fullBodyIK.internalValues.defaultRootBasis.column2 * 1f;
				}
			}

			// Token: 0x06000845 RID: 2117 RVA: 0x0004B564 File Offset: 0x00049764
			public void _ComputeDefaultTransform(FullBodyIK fullBodyIK)
			{
				if (this._parentEffector != null)
				{
					this._defaultRotation = this._parentEffector._defaultRotation;
				}
				if (this._effectorType == FullBodyIK.EffectorType.Root)
				{
					this._defaultPosition = fullBodyIK.internalValues.defaultRootPosition;
					this._defaultRotation = fullBodyIK.internalValues.defaultRootRotation;
				}
				else if (this._effectorType == FullBodyIK.EffectorType.HandFinger)
				{
					if (this._bone != null)
					{
						if (this._bone.transformIsAlive)
						{
							this._defaultPosition = this.bone._defaultPosition;
						}
						else if (this._bone.parentBoneLocationBased != null && this._bone.parentBoneLocationBased.parentBoneLocationBased != null)
						{
							Vector3 b = this.bone.parentBoneLocationBased._defaultPosition - this.bone.parentBoneLocationBased.parentBoneLocationBased._defaultPosition;
							this._defaultPosition = this.bone.parentBoneLocationBased._defaultPosition + b;
							this._isSimulateFingerTips = true;
						}
					}
				}
				else if (this._effectorType == FullBodyIK.EffectorType.Eyes)
				{
					this._isHiddenEyes = fullBodyIK._IsHiddenCustomEyes();
					if (!this._isHiddenEyes && this._bone != null && this._bone.transformIsAlive && this._leftBone != null && this._leftBone.transformIsAlive && this._rightBone != null && this._rightBone.transformIsAlive)
					{
						this._defaultPosition = (this._leftBone._defaultPosition + this._rightBone._defaultPosition) * 0.5f;
					}
					else if (this._bone != null && this._bone.transformIsAlive)
					{
						this._defaultPosition = this._bone._defaultPosition;
						if (this._bone.parentBone != null && this._bone.parentBone.transformIsAlive && this._bone.parentBone.boneType == FullBodyIK.BoneType.Neck)
						{
							Vector3 vector = this._bone._defaultPosition - this._bone.parentBone._defaultPosition;
							float d = (vector.y <= 0f) ? 0f : vector.y;
							this._defaultPosition += fullBodyIK.internalValues.defaultRootBasis.column1 * d;
							this._defaultPosition += fullBodyIK.internalValues.defaultRootBasis.column2 * d;
						}
					}
				}
				else if (this._effectorType == FullBodyIK.EffectorType.Hips)
				{
					if (this._bone != null && this._leftBone != null && this._rightBone != null)
					{
						this._defaultPosition = (this._leftBone._defaultPosition + this._rightBone._defaultPosition) * 0.5f;
					}
				}
				else if (this._bone != null)
				{
					this._defaultPosition = this.bone._defaultPosition;
					if (!this._defaultLocalBasisIsIdentity)
					{
						this._defaultRotation = this.bone._localAxisRotation;
					}
				}
			}

			// Token: 0x06000846 RID: 2118 RVA: 0x0004B8AC File Offset: 0x00049AAC
			private void _ClearInternal()
			{
				this._transformIsAlive = -1;
				this._defaultPosition = Vector3.zero;
				this._defaultRotation = Quaternion.identity;
			}

			// Token: 0x06000847 RID: 2119 RVA: 0x0004B8CB File Offset: 0x00049ACB
			public void PrepareUpdate()
			{
				this._transformIsAlive = -1;
				this._isReadWorldPosition = false;
				this._isReadWorldRotation = false;
				this._isWrittenWorldPosition = false;
				this._isWrittenWorldRotation = false;
			}

			// Token: 0x17000132 RID: 306
			// (get) Token: 0x06000848 RID: 2120 RVA: 0x0004B8F0 File Offset: 0x00049AF0
			// (set) Token: 0x06000849 RID: 2121 RVA: 0x0004B93C File Offset: 0x00049B3C
			public Vector3 worldPosition
			{
				get
				{
					if (!this._isReadWorldPosition && !this._isWrittenWorldPosition)
					{
						this._isReadWorldPosition = true;
						if (this.transformIsAlive)
						{
							this._worldPosition = this.transform.position;
						}
					}
					return this._worldPosition;
				}
				set
				{
					this._isWrittenWorldPosition = true;
					this._worldPosition = value;
				}
			}

			// Token: 0x17000133 RID: 307
			// (get) Token: 0x0600084A RID: 2122 RVA: 0x0004B94C File Offset: 0x00049B4C
			public Vector3 bone_worldPosition
			{
				get
				{
					if (this._effectorType == FullBodyIK.EffectorType.Eyes)
					{
						if (!this._isHiddenEyes && this._bone != null && this._bone.transformIsAlive && this._leftBone != null && this._leftBone.transformIsAlive && this._rightBone != null && this._rightBone.transformIsAlive)
						{
							return (this._leftBone.worldPosition + this._rightBone.worldPosition) * 0.5f;
						}
						if (this._bone != null && this._bone.transformIsAlive)
						{
							Vector3 vector = this._bone.worldPosition;
							if (this._bone.parentBone != null && this._bone.parentBone.transformIsAlive && this._bone.parentBone.boneType == FullBodyIK.BoneType.Neck)
							{
								Vector3 vector2 = this._bone._defaultPosition - this._bone.parentBone._defaultPosition;
								float d = (vector2.y <= 0f) ? 0f : vector2.y;
								Quaternion quaternion = this._bone.parentBone.worldRotation * this._bone.parentBone._worldToBaseRotation;
								FullBodyIK.Matrix3x3 matrix3x;
								FullBodyIK.SAFBIKMatSetRot(out matrix3x, ref quaternion);
								vector += matrix3x.column1 * d;
								vector += matrix3x.column2 * d;
							}
							return vector;
						}
					}
					else if (this._isSimulateFingerTips)
					{
						if (this._bone != null && this._bone.parentBoneLocationBased != null && this._bone.parentBoneLocationBased.transformIsAlive && this._bone.parentBoneLocationBased.parentBoneLocationBased != null && this._bone.parentBoneLocationBased.parentBoneLocationBased.transformIsAlive)
						{
							Vector3 worldPosition = this._bone.parentBoneLocationBased.worldPosition;
							Vector3 worldPosition2 = this._bone.parentBoneLocationBased.parentBoneLocationBased.worldPosition;
							return worldPosition + (worldPosition - worldPosition2);
						}
					}
					else if (this._bone != null && this._bone.transformIsAlive)
					{
						return this._bone.worldPosition;
					}
					return this.worldPosition;
				}
			}

			// Token: 0x17000134 RID: 308
			// (get) Token: 0x0600084B RID: 2123 RVA: 0x0004BBC4 File Offset: 0x00049DC4
			// (set) Token: 0x0600084C RID: 2124 RVA: 0x0004BC10 File Offset: 0x00049E10
			public Quaternion worldRotation
			{
				get
				{
					if (!this._isReadWorldRotation && !this._isWrittenWorldRotation)
					{
						this._isReadWorldRotation = true;
						if (this.transformIsAlive)
						{
							this._worldRotation = this.transform.rotation;
						}
					}
					return this._worldRotation;
				}
				set
				{
					this._isWrittenWorldRotation = true;
					this._worldRotation = value;
				}
			}

			// Token: 0x0600084D RID: 2125 RVA: 0x0004BC20 File Offset: 0x00049E20
			public void WriteToTransform()
			{
				if (this._isWrittenWorldPosition)
				{
					this._isWrittenWorldPosition = false;
					if (this.transformIsAlive)
					{
						this.transform.position = this._worldPosition;
					}
				}
				if (this._isWrittenWorldRotation)
				{
					this._isWrittenWorldRotation = false;
					if (this.transformIsAlive)
					{
						this.transform.rotation = this._worldRotation;
					}
				}
			}

			// Token: 0x04000D35 RID: 3381
			public Transform transform;

			// Token: 0x04000D36 RID: 3382
			public bool positionEnabled;

			// Token: 0x04000D37 RID: 3383
			public bool rotationEnabled;

			// Token: 0x04000D38 RID: 3384
			public float positionWeight = 1f;

			// Token: 0x04000D39 RID: 3385
			public float rotationWeight = 1f;

			// Token: 0x04000D3A RID: 3386
			public float pull;

			// Token: 0x04000D3B RID: 3387
			[NonSerialized]
			public Vector3 _hidden_worldPosition = Vector3.zero;

			// Token: 0x04000D3C RID: 3388
			[SerializeField]
			private bool _isPresetted;

			// Token: 0x04000D3D RID: 3389
			[SerializeField]
			private FullBodyIK.EffectorLocation _effectorLocation = FullBodyIK.EffectorLocation.Max;

			// Token: 0x04000D3E RID: 3390
			[SerializeField]
			private FullBodyIK.EffectorType _effectorType = FullBodyIK.EffectorType.Max;

			// Token: 0x04000D3F RID: 3391
			[SerializeField]
			private FullBodyIK.Effector._EffectorFlags _effectorFlags;

			// Token: 0x04000D40 RID: 3392
			private FullBodyIK.Effector _parentEffector;

			// Token: 0x04000D41 RID: 3393
			private FullBodyIK.Bone _bone;

			// Token: 0x04000D42 RID: 3394
			private FullBodyIK.Bone _leftBone;

			// Token: 0x04000D43 RID: 3395
			private FullBodyIK.Bone _rightBone;

			// Token: 0x04000D44 RID: 3396
			[SerializeField]
			private Transform _createdTransform;

			// Token: 0x04000D45 RID: 3397
			[SerializeField]
			public Vector3 _defaultPosition = Vector3.zero;

			// Token: 0x04000D46 RID: 3398
			[SerializeField]
			public Quaternion _defaultRotation = Quaternion.identity;

			// Token: 0x04000D47 RID: 3399
			public bool _isSimulateFingerTips;

			// Token: 0x04000D48 RID: 3400
			[NonSerialized]
			public Vector3 _worldPosition = Vector3.zero;

			// Token: 0x04000D49 RID: 3401
			[NonSerialized]
			public Quaternion _worldRotation = Quaternion.identity;

			// Token: 0x04000D4A RID: 3402
			private bool _isReadWorldPosition;

			// Token: 0x04000D4B RID: 3403
			private bool _isReadWorldRotation;

			// Token: 0x04000D4C RID: 3404
			private bool _isWrittenWorldPosition;

			// Token: 0x04000D4D RID: 3405
			private bool _isWrittenWorldRotation;

			// Token: 0x04000D4E RID: 3406
			private bool _isHiddenEyes;

			// Token: 0x04000D4F RID: 3407
			private int _transformIsAlive = -1;

			// Token: 0x02000198 RID: 408
			[Flags]
			private enum _EffectorFlags
			{
				// Token: 0x04000D51 RID: 3409
				None = 0,
				// Token: 0x04000D52 RID: 3410
				RotationContained = 1,
				// Token: 0x04000D53 RID: 3411
				PullContained = 2
			}
		}

		// Token: 0x02000199 RID: 409
		public class FingerIK
		{
			// Token: 0x0600084E RID: 2126 RVA: 0x0004BC8C File Offset: 0x00049E8C
			public FingerIK(FullBodyIK fullBodyIK, FullBodyIK.FingerIKType fingerIKType)
			{
				this._fingerIKType = fingerIKType;
				this._settings = fullBodyIK.settings;
				this._internalValues = fullBodyIK.internalValues;
				FullBodyIK.FingersBones fingersBones = null;
				FullBodyIK.FingersEffectors fingersEffectors = null;
				if (fingerIKType != FullBodyIK.FingerIKType.LeftWrist)
				{
					if (fingerIKType == FullBodyIK.FingerIKType.RightWrist)
					{
						this._parentBone = fullBodyIK.rightArmBones.wrist;
						fingersBones = fullBodyIK.rightHandFingersBones;
						fingersEffectors = fullBodyIK.rightHandFingersEffectors;
					}
				}
				else
				{
					this._parentBone = fullBodyIK.leftArmBones.wrist;
					fingersBones = fullBodyIK.leftHandFingersBones;
					fingersEffectors = fullBodyIK.leftHandFingersEffectors;
				}
				this._notThumb1PitchUTraceSmooth = new FullBodyIK.FastAngle(this._notThumb1PitchUTrace.angle + this._notThumb1PitchUSmooth.angle);
				if (fingersBones != null && fingersEffectors != null)
				{
					for (int i = 0; i < 5; i++)
					{
						FullBodyIK.Bone[] array = null;
						FullBodyIK.Effector effector = null;
						switch (i)
						{
						case 0:
							array = fingersBones.thumb;
							effector = fingersEffectors.thumb;
							break;
						case 1:
							array = fingersBones.index;
							effector = fingersEffectors.index;
							break;
						case 2:
							array = fingersBones.middle;
							effector = fingersEffectors.middle;
							break;
						case 3:
							array = fingersBones.ring;
							effector = fingersEffectors.ring;
							break;
						case 4:
							array = fingersBones.little;
							effector = fingersEffectors.little;
							break;
						}
						if (array != null && effector != null)
						{
							this._PrepareBranch(i, array, effector);
						}
					}
				}
			}

			// Token: 0x0600084F RID: 2127 RVA: 0x0004BE98 File Offset: 0x0004A098
			private void _PrepareBranch(int fingerType, FullBodyIK.Bone[] bones, FullBodyIK.Effector effector)
			{
				if (this._parentBone == null || bones == null || effector == null)
				{
					return;
				}
				int num = bones.Length;
				if (num == 0)
				{
					return;
				}
				if (effector.bone != null && bones[num - 1] == effector.bone)
				{
					num--;
					if (num == 0)
					{
						return;
					}
				}
				if (num != 0 && (bones[num - 1] == null || bones[num - 1].transform == null))
				{
					num--;
					if (num == 0)
					{
						return;
					}
				}
				FullBodyIK.FingerIK._FingerBranch fingerBranch = new FullBodyIK.FingerIK._FingerBranch();
				fingerBranch.effector = effector;
				fingerBranch.fingerLinks = new FullBodyIK.FingerIK._FingerLink[num];
				for (int i = 0; i < num; i++)
				{
					if (bones[i] == null || bones[i].transform == null)
					{
						return;
					}
					FullBodyIK.FingerIK._FingerLink fingerLink = new FullBodyIK.FingerIK._FingerLink();
					fingerLink.bone = bones[i];
					fingerBranch.fingerLinks[i] = fingerLink;
				}
				this._fingerBranches[fingerType] = fingerBranch;
				if (fingerType == 0)
				{
					this._thumbBranch = new FullBodyIK.FingerIK._ThumbBranch();
					this._thumbBranch.thumbLinks = new FullBodyIK.FingerIK._ThumbLink[num];
					for (int num2 = 0; num2 != num; num2++)
					{
						this._thumbBranch.thumbLinks[num2] = new FullBodyIK.FingerIK._ThumbLink();
					}
				}
			}

			// Token: 0x06000850 RID: 2128 RVA: 0x0004BFD4 File Offset: 0x0004A1D4
			private static bool _SolveThumbYZ(ref FullBodyIK.Matrix3x3 middleBoneToSolvedBasis, ref Vector3 thumbSolveY, ref Vector3 thumbSolveZ)
			{
				if (FullBodyIK.SAFBIKVecNormalize2(ref thumbSolveY, ref thumbSolveZ))
				{
					if (Mathf.Abs(thumbSolveY.z) > Mathf.Abs(thumbSolveZ.z))
					{
						Vector3 vector = thumbSolveY;
						thumbSolveY = thumbSolveZ;
						thumbSolveZ = vector;
					}
					if (thumbSolveY.y < 0f)
					{
						thumbSolveY = -thumbSolveY;
					}
					if (thumbSolveZ.z < 0f)
					{
						thumbSolveZ = -thumbSolveZ;
					}
					FullBodyIK.SAFBIKMatMultVec(out thumbSolveY, ref middleBoneToSolvedBasis, ref thumbSolveY);
					FullBodyIK.SAFBIKMatMultVec(out thumbSolveZ, ref middleBoneToSolvedBasis, ref thumbSolveZ);
					return true;
				}
				thumbSolveY = Vector3.zero;
				thumbSolveZ = Vector3.zero;
				return false;
			}

			// Token: 0x06000851 RID: 2129 RVA: 0x0004C090 File Offset: 0x0004A290
			private void _PrepareBranch2(int fingerType)
			{
				FullBodyIK.FingerIK._FingerBranch fingerBranch = this._fingerBranches[fingerType];
				if (this._parentBone == null || fingerBranch == null)
				{
					return;
				}
				FullBodyIK.Effector effector = fingerBranch.effector;
				int num = fingerBranch.fingerLinks.Length;
				bool flag = this._fingerIKType == FullBodyIK.FingerIKType.RightWrist;
				if (fingerBranch.fingerLinks != null && fingerBranch.fingerLinks.Length > 0 && fingerBranch.fingerLinks[0].bone != null)
				{
					Vector3 vector = effector.defaultPosition - fingerBranch.fingerLinks[0].bone._defaultPosition;
					vector = ((!flag) ? (-vector) : vector);
					if (FullBodyIK.SAFBIKVecNormalize(ref vector) && FullBodyIK.SAFBIKComputeBasisFromXZLockX(out fingerBranch.boneToSolvedBasis, vector, this._internalValues.defaultRootBasis.column2))
					{
						fingerBranch.solvedToBoneBasis = fingerBranch.boneToSolvedBasis.transpose;
					}
					fingerBranch.link0ToEffectorLength = FullBodyIK.SAFBIKVecLengthAndLengthSq2(out fingerBranch.link0ToEffectorLengthSq, ref effector._defaultPosition, ref fingerBranch.fingerLinks[0].bone._defaultPosition);
				}
				if (fingerType == 0)
				{
					FullBodyIK.FingerIK._FingerBranch fingerBranch2 = this._fingerBranches[2];
					if (fingerBranch2 == null)
					{
						return;
					}
					if (fingerBranch2.fingerLinks.Length >= 1)
					{
						FullBodyIK.FingerIK._FingerLink fingerLink = fingerBranch2.fingerLinks[0];
						FullBodyIK.Matrix3x3 identity = FullBodyIK.Matrix3x3.identity;
						FullBodyIK.Matrix3x3 matrix3x = FullBodyIK.Matrix3x3.identity;
						Vector3 vector2 = fingerLink.bone._defaultPosition - this._parentBone._defaultPosition;
						if (FullBodyIK.SAFBIKVecNormalize(ref vector2))
						{
							vector2 = ((!flag) ? (-vector2) : vector2);
							if (FullBodyIK.SAFBIKComputeBasisFromXZLockX(out identity, vector2, this._internalValues.defaultRootBasis.column2))
							{
								matrix3x = identity.transpose;
							}
						}
						bool flag2 = false;
						if (num >= 2 && !effector._isSimulateFingerTips)
						{
							FullBodyIK.FingerIK._FingerLink fingerLink2 = fingerBranch.fingerLinks[num - 2];
							FullBodyIK.FingerIK._FingerLink fingerLink3 = fingerBranch.fingerLinks[num - 1];
							Vector3 defaultPosition = fingerLink2.bone._defaultPosition;
							Vector3 defaultPosition2 = fingerLink3.bone._defaultPosition;
							Vector3 defaultPosition3 = effector._defaultPosition;
							Vector3 lhs = defaultPosition2 - defaultPosition;
							Vector3 vector3 = defaultPosition3 - defaultPosition2;
							FullBodyIK.SAFBIKMatMultVec(out lhs, ref matrix3x, ref lhs);
							FullBodyIK.SAFBIKMatMultVec(out vector3, ref matrix3x, ref vector3);
							Vector3 vector4 = Vector3.Cross(lhs, vector3);
							this._thumbBranch.thumbSolveY = vector4;
							this._thumbBranch.thumbSolveZ = Vector3.Cross(vector3, vector4);
							flag2 = FullBodyIK.FingerIK._SolveThumbYZ(ref identity, ref this._thumbBranch.thumbSolveY, ref this._thumbBranch.thumbSolveZ);
						}
						if (!flag2 && num >= 3)
						{
							FullBodyIK.FingerIK._FingerLink fingerLink4 = fingerBranch.fingerLinks[num - 3];
							FullBodyIK.FingerIK._FingerLink fingerLink5 = fingerBranch.fingerLinks[num - 2];
							FullBodyIK.FingerIK._FingerLink fingerLink6 = fingerBranch.fingerLinks[num - 1];
							Vector3 defaultPosition4 = fingerLink4.bone._defaultPosition;
							Vector3 defaultPosition5 = fingerLink5.bone._defaultPosition;
							Vector3 defaultPosition6 = fingerLink6.bone._defaultPosition;
							Vector3 lhs2 = defaultPosition5 - defaultPosition4;
							Vector3 vector5 = defaultPosition6 - defaultPosition5;
							FullBodyIK.SAFBIKMatMultVec(out lhs2, ref matrix3x, ref lhs2);
							FullBodyIK.SAFBIKMatMultVec(out vector5, ref matrix3x, ref vector5);
							Vector3 vector6 = Vector3.Cross(lhs2, vector5);
							this._thumbBranch.thumbSolveY = vector6;
							this._thumbBranch.thumbSolveZ = Vector3.Cross(vector5, vector6);
							flag2 = FullBodyIK.FingerIK._SolveThumbYZ(ref identity, ref this._thumbBranch.thumbSolveY, ref this._thumbBranch.thumbSolveZ);
						}
						if (!flag2)
						{
							this._thumbBranch.thumbSolveZ = new Vector3(0f, 1f, 2f);
							this._thumbBranch.thumbSolveY = new Vector3(0f, 2f, -1f);
							FullBodyIK.SAFBIKVecNormalize2(ref this._thumbBranch.thumbSolveZ, ref this._thumbBranch.thumbSolveY);
						}
					}
				}
				for (int num2 = 0; num2 != fingerBranch.fingerLinks.Length; num2++)
				{
					FullBodyIK.FingerIK._FingerLink fingerLink7 = fingerBranch.fingerLinks[num2];
					Vector3 defaultPosition7 = fingerLink7.bone._defaultPosition;
					FullBodyIK.FastLength fastLength;
					Vector3 vector7;
					if (num2 + 1 != fingerBranch.fingerLinks.Length)
					{
						Vector3 defaultPosition8 = fingerBranch.fingerLinks[num2 + 1].bone._defaultPosition;
						fastLength = fingerBranch.fingerLinks[num2 + 1].bone._defaultLocalLength;
						vector7 = fingerBranch.fingerLinks[num2 + 1].bone._defaultLocalDirection;
					}
					else
					{
						Vector3 defaultPosition8 = fingerBranch.effector._defaultPosition;
						if (!fingerBranch.effector._isSimulateFingerTips)
						{
							fastLength = fingerBranch.effector.bone._defaultLocalLength;
							vector7 = fingerBranch.effector.bone._defaultLocalDirection;
						}
						else
						{
							Vector3 a = defaultPosition8 - defaultPosition7;
							fastLength = FullBodyIK.FastLength.FromVector3(ref a);
							if (fastLength.length > 1E-45f)
							{
								vector7 = a * (1f / fastLength.length);
							}
							else
							{
								vector7 = Vector3.zero;
							}
						}
					}
					if (fingerType != 0)
					{
						fingerLink7.childToLength = fastLength.length;
						fingerLink7.childToLengthSq = fastLength.lengthSq;
					}
					Vector3 vector8 = vector7;
					if (vector8.x != 0f || vector8.y != 0f || vector8.z != 0f)
					{
						vector8 = ((!flag) ? (-vector8) : vector8);
						if (FullBodyIK.SAFBIKComputeBasisFromXZLockX(out fingerLink7.boneToSolvedBasis, vector8, this._internalValues.defaultRootBasis.column2))
						{
							fingerLink7.solvedToBoneBasis = fingerLink7.boneToSolvedBasis.transpose;
						}
					}
					if (fingerType == 0)
					{
						FullBodyIK.FingerIK._ThumbLink thumbLink = this._thumbBranch.thumbLinks[num2];
						Vector3 vector9 = fingerBranch.effector._defaultPosition - defaultPosition7;
						if (FullBodyIK.SAFBIKVecNormalize(ref vector9))
						{
							vector9 = ((!flag) ? (-vector9) : vector9);
							if (FullBodyIK.SAFBIKComputeBasisFromXYLockX(out thumbLink.thumb_boneToSolvedBasis, ref vector9, ref this._thumbBranch.thumbSolveY))
							{
								thumbLink.thumb_solvedToBoneBasis = thumbLink.thumb_boneToSolvedBasis.transpose;
							}
						}
					}
				}
				if (fingerType != 0 && fingerBranch.fingerLinks.Length == 3)
				{
					fingerBranch.notThumb1BaseAngle = new FullBodyIK.FastAngle(FullBodyIK.FingerIK._ComputeJointBaseAngle(ref this._internalValues.defaultRootBasis, ref fingerBranch.fingerLinks[0].bone._defaultPosition, ref fingerBranch.fingerLinks[1].bone._defaultPosition, ref fingerBranch.effector._defaultPosition, flag));
					fingerBranch.notThumb2BaseAngle = new FullBodyIK.FastAngle(FullBodyIK.FingerIK._ComputeJointBaseAngle(ref this._internalValues.defaultRootBasis, ref fingerBranch.fingerLinks[1].bone._defaultPosition, ref fingerBranch.fingerLinks[2].bone._defaultPosition, ref fingerBranch.effector._defaultPosition, flag));
					float childToLength = fingerBranch.fingerLinks[0].childToLength;
					float childToLength2 = fingerBranch.fingerLinks[1].childToLength;
					float childToLength3 = fingerBranch.fingerLinks[2].childToLength;
					float num3 = Mathf.Abs(childToLength - childToLength3);
					float num4 = FullBodyIK.SAFBIKSqrt(childToLength2 * childToLength2 - num3 * num3);
					float beginLink_endCosTheta = 0f;
					if (childToLength > childToLength3)
					{
						float cos = this._notThumb0FingerIKLimit.cos;
						float sin = this._notThumb0FingerIKLimit.sin;
						float num5 = num4 * (1f / childToLength2);
						if (num5 < cos)
						{
							num4 = cos * childToLength2;
							num3 = sin * childToLength2;
							float num6 = Mathf.Clamp01((childToLength3 + num3) * (1f / childToLength));
							beginLink_endCosTheta = FullBodyIK.SAFBIKSqrtClamp01(1f - num6 * num6);
						}
					}
					float num7 = childToLength2 - num4;
					float num8 = childToLength + childToLength3;
					float num9 = num8 + num7;
					num9 = ((num9 <= 1E-07f) ? 0f : (1f / num9));
					fingerBranch.fingerIKParams.lengthD0 = num4;
					fingerBranch.fingerIKParams.lengthABCDInv = num9;
					fingerBranch.fingerIKParams.beginLink_endCosTheta = beginLink_endCosTheta;
				}
			}

			// Token: 0x06000852 RID: 2130 RVA: 0x0004C844 File Offset: 0x0004AA44
			private void _PrepareThumb()
			{
				FullBodyIK.FingerIK._FingerBranch fingerBranch = this._fingerBranches[0];
				FullBodyIK.FingerIK._FingerBranch fingerBranch2 = this._fingerBranches[1];
				if (fingerBranch == null || fingerBranch.fingerLinks.Length != 3 || fingerBranch2 == null || fingerBranch2.fingerLinks.Length == 0)
				{
					return;
				}
				FullBodyIK.FingerIK._FingerLink fingerLink = fingerBranch.fingerLinks[0];
				FullBodyIK.FingerIK._FingerLink fingerLink2 = fingerBranch.fingerLinks[1];
				FullBodyIK.FingerIK._FingerLink fingerLink3 = fingerBranch.fingerLinks[2];
				FullBodyIK.FingerIK._FingerLink fingerLink4 = fingerBranch2.fingerLinks[0];
				Vector3 vector = fingerLink4.bone._defaultPosition - fingerLink.bone._defaultPosition;
				Vector3 vector2;
				FullBodyIK.SAFBIKMatMultVec(out vector2, ref fingerBranch.solvedToBoneBasis, ref vector);
				if (FullBodyIK.SAFBIKVecNormalize(ref vector2))
				{
					this._thumbBranch.thumb0_isLimited = true;
					this._thumbBranch.thumb0_innerLimit = Mathf.Max(-vector2.z, 0f);
					this._thumbBranch.thumb0_outerLimit = (float)Math.Sin((double)Mathf.Max(-(FullBodyIK.SAFBIKAsin(this._thumbBranch.thumb0_innerLimit) - 0.6981317f), 0f));
					this._thumbBranch.thumb0_upperLimit = Mathf.Max(vector2.y, 0f);
					this._thumbBranch.thumb0_lowerLimit = (float)Math.Sin((double)Mathf.Max(-(FullBodyIK.SAFBIKAsin(this._thumbBranch.thumb0_upperLimit) - 0.7853982f), 0f));
				}
				this._thumbBranch.linkLength0to1 = FullBodyIK.SAFBIKVecLengthAndLengthSq2(out this._thumbBranch.linkLength0to1Sq, ref fingerLink2.bone._defaultPosition, ref fingerLink.bone._defaultPosition);
				this._thumbBranch.linkLength1to2 = FullBodyIK.SAFBIKVecLengthAndLengthSq2(out this._thumbBranch.linkLength1to2Sq, ref fingerLink3.bone._defaultPosition, ref fingerLink2.bone._defaultPosition);
				this._thumbBranch.linkLength2to3 = FullBodyIK.SAFBIKVecLengthAndLengthSq2(out this._thumbBranch.linkLength2to3Sq, ref fingerBranch.effector._defaultPosition, ref fingerLink3.bone._defaultPosition);
				this._thumbBranch.linkLength1to3 = FullBodyIK.SAFBIKVecLengthAndLengthSq2(out this._thumbBranch.linkLength1to3Sq, ref fingerBranch.effector._defaultPosition, ref fingerLink2.bone._defaultPosition);
				this._thumbBranch.thumb1_baseThetaAtoB = FullBodyIK.FingerIK._ComputeTriangleTheta(this._thumbBranch.linkLength1to2, this._thumbBranch.linkLength1to3, this._thumbBranch.linkLength2to3, this._thumbBranch.linkLength1to2Sq, this._thumbBranch.linkLength1to3Sq, this._thumbBranch.linkLength2to3Sq);
				this._thumbBranch.thumb1_Acos_baseThetaAtoB = FullBodyIK.SAFBIKAcos(this._thumbBranch.thumb1_baseThetaAtoB);
			}

			// Token: 0x06000853 RID: 2131 RVA: 0x0004CAC8 File Offset: 0x0004ACC8
			private void _SyncDisplacement()
			{
				if (this._settings.syncDisplacement == FullBodyIK.SyncDisplacement.Everyframe || !this._isSyncDisplacementAtLeastOnce)
				{
					this._isSyncDisplacementAtLeastOnce = true;
					for (int num = 0; num != 5; num++)
					{
						this._PrepareBranch2(num);
					}
					this._PrepareThumb();
				}
			}

			// Token: 0x06000854 RID: 2132 RVA: 0x0004CB18 File Offset: 0x0004AD18
			private static float _ComputeJointBaseAngle(ref FullBodyIK.Matrix3x3 rootBaseBasis, ref Vector3 beginPosition, ref Vector3 nextPosition, ref Vector3 endPosition, bool isRight)
			{
				Vector3 vector = endPosition - beginPosition;
				Vector3 vector2 = nextPosition - beginPosition;
				if (FullBodyIK.SAFBIKVecNormalize2(ref vector, ref vector2))
				{
					Vector3 dirX = (!isRight) ? (-vector) : vector;
					FullBodyIK.Matrix3x3 matrix3x;
					FullBodyIK.SAFBIKComputeBasisFromXZLockX(out matrix3x, dirX, rootBaseBasis.column2);
					dirX = ((!isRight) ? (-vector2) : vector2);
					Vector3 column = matrix3x.column2;
					FullBodyIK.Matrix3x3 matrix3x2;
					FullBodyIK.SAFBIKComputeBasisFromXZLockZ(out matrix3x2, ref dirX, ref column);
					float cos = Vector3.Dot(matrix3x.column0, matrix3x2.column0);
					float num = Vector3.Dot(matrix3x.column1, matrix3x2.column0);
					float num2 = FullBodyIK.SAFBIKAcos(cos);
					if (num < 0f)
					{
						num2 = -num2;
					}
					return num2;
				}
				return 0f;
			}

			// Token: 0x06000855 RID: 2133 RVA: 0x0004CBF0 File Offset: 0x0004ADF0
			private static bool _SolveInDirect(bool isRight, ref Vector3 solvedDirY, ref Vector3 solvedDirZ, ref FullBodyIK.Matrix3x3 rootBasis, ref FullBodyIK.Matrix3x3 linkBoneToSolvedBasis, ref Vector3 effectorDirection)
			{
				Vector3 vector = (!isRight) ? (-effectorDirection) : effectorDirection;
				Vector3 vector2;
				FullBodyIK.SAFBIKMatMultVec(out vector2, ref rootBasis, ref linkBoneToSolvedBasis.column2);
				FullBodyIK.Matrix3x3 matrix3x;
				if (!FullBodyIK.SAFBIKComputeBasisFromXZLockX(out matrix3x, ref vector, ref vector2))
				{
					return false;
				}
				solvedDirY = matrix3x.column1;
				solvedDirZ = matrix3x.column2;
				return true;
			}

			// Token: 0x06000856 RID: 2134 RVA: 0x0004CC58 File Offset: 0x0004AE58
			private static float _ComputeTriangleTheta(float lenA, float lenB, float lenC, float lenASq, float lenBSq, float lenCSq)
			{
				float num = lenA * lenB;
				if (num >= 1E-07f)
				{
					return (lenASq + lenBSq - lenCSq) / (2f * num);
				}
				return 1f;
			}

			// Token: 0x06000857 RID: 2135 RVA: 0x0004CC8C File Offset: 0x0004AE8C
			private static void _LerpEffectorLength(ref float effectorLength, ref Vector3 effectorDirection, ref Vector3 effectorTranslate, ref Vector3 effectorPosition, ref Vector3 effectorOrigin, float minLength, float maxLength, float lerpLength)
			{
				if (lerpLength > 1E-07f)
				{
					float num = effectorLength - minLength;
					float num2 = num / lerpLength;
					effectorLength = minLength + num2 * (maxLength - minLength);
				}
				else
				{
					effectorLength = minLength;
				}
				effectorTranslate = effectorLength * effectorDirection;
				effectorPosition = effectorOrigin + effectorTranslate;
			}

			// Token: 0x06000858 RID: 2136 RVA: 0x0004CCF0 File Offset: 0x0004AEF0
			private static Vector3 SolveFingerIK(ref Vector3 beginPosition, ref Vector3 endPosition, ref Vector3 bendingDirection, float linkLength0, float linkLength1, float linkLength2, ref FullBodyIK.FingerIK._FingerIKParams fingerIKParams)
			{
				float num = linkLength0 + linkLength1 + linkLength2;
				float magnitude = (endPosition - beginPosition).magnitude;
				if (magnitude <= 1E-07f)
				{
					return Vector3.zero;
				}
				Vector3 vector = endPosition - beginPosition;
				vector *= 1f / magnitude;
				if (magnitude >= num - 1E-07f)
				{
					return vector;
				}
				if (linkLength0 <= 1E-07f || linkLength1 <= 1E-07f || linkLength2 <= 1E-07f)
				{
					return Vector3.zero;
				}
				Vector3 vector2 = Vector3.Cross(vector, bendingDirection);
				vector2 = Vector3.Cross(vector2, vector);
				float magnitude2 = vector2.magnitude;
				if (magnitude2 <= 1E-07f)
				{
					return Vector3.zero;
				}
				vector2 *= 1f / magnitude2;
				float num2 = Mathf.Lerp(fingerIKParams.beginLink_endCosTheta, 1f, Mathf.Clamp01((magnitude - fingerIKParams.lengthD0) * fingerIKParams.lengthABCDInv));
				float d = FullBodyIK.SAFBIKSqrtClamp01(1f - num2 * num2);
				Vector3 result = vector * num2 + vector2 * d;
				if (!FullBodyIK.SAFBIKVecNormalize(ref result))
				{
					return Vector3.zero;
				}
				return result;
			}

			// Token: 0x06000859 RID: 2137 RVA: 0x0004CE34 File Offset: 0x0004B034
			private static Vector3 SolveLimbIK(ref Vector3 beginPosition, ref Vector3 endPosition, float beginToInterBaseLength, float beginToInterBaseLengthSq, float interToEndBaseLength, float interToEndBaseLengthSq, ref Vector3 bendingDirection)
			{
				float num = beginToInterBaseLength + interToEndBaseLength;
				if (num <= 1E-07f)
				{
					return Vector3.zero;
				}
				float sqrMagnitude = (endPosition - beginPosition).sqrMagnitude;
				float num2 = FullBodyIK.SAFBIKSqrt(sqrMagnitude);
				if (num2 <= 1E-07f)
				{
					return Vector3.zero;
				}
				Vector3 vector = (endPosition - beginPosition) * (1f / num2);
				if (num2 >= num - 1E-07f)
				{
					return vector;
				}
				Vector3 vector2 = Vector3.Cross(vector, bendingDirection);
				vector2 = Vector3.Cross(vector2, vector);
				float magnitude = vector2.magnitude;
				if (magnitude <= 1E-07f)
				{
					return Vector3.zero;
				}
				vector2 *= 1f / magnitude;
				float num3 = 1f;
				float num4 = num2;
				float num5 = sqrMagnitude;
				if (num2 < num)
				{
					float num6 = 2f * beginToInterBaseLength * num4;
					if (num6 > 1E-07f)
					{
						num3 = (interToEndBaseLengthSq - beginToInterBaseLengthSq - num5) / -num6;
					}
				}
				float d = FullBodyIK.SAFBIKSqrtClamp01(1f - num3 * num3);
				Vector3 a = vector * num3 * beginToInterBaseLength + vector2 * d * beginToInterBaseLength;
				float magnitude2 = a.magnitude;
				if (magnitude2 <= 1E-07f)
				{
					return Vector3.zero;
				}
				return a * (1f / magnitude2);
			}

			// Token: 0x0600085A RID: 2138 RVA: 0x0004CFAC File Offset: 0x0004B1AC
			public bool Solve()
			{
				if (this._parentBone == null)
				{
					return false;
				}
				this._SyncDisplacement();
				bool flag = false;
				FullBodyIK.Matrix3x4 identity = FullBodyIK.Matrix3x4.identity;
				identity.origin = this._parentBone.worldPosition;
				Quaternion worldRotation = this._parentBone.worldRotation;
				FullBodyIK.SAFBIKMatSetRotMultInv1(out identity.basis, ref worldRotation, ref this._parentBone._defaultRotation);
				for (int num = 0; num != 5; num++)
				{
					FullBodyIK.FingerIK._FingerBranch fingerBranch = this._fingerBranches[num];
					if (fingerBranch != null && fingerBranch.effector != null && fingerBranch.effector.positionEnabled)
					{
						if (num == 0)
						{
							flag |= this._SolveThumb(ref identity);
						}
						else
						{
							flag |= this._SolveNotThumb(num, ref identity);
						}
					}
				}
				return flag;
			}

			// Token: 0x0600085B RID: 2139 RVA: 0x0004D074 File Offset: 0x0004B274
			private static Vector3 _GetEffectorPosition(FullBodyIK.InternalValues internalValues, FullBodyIK.Bone rootBone, FullBodyIK.Bone beginLinkBone, FullBodyIK.Effector effector, float link0ToEffectorLength, ref FullBodyIK.Matrix3x4 parentTransform)
			{
				if (rootBone != null && beginLinkBone != null && effector != null)
				{
					Vector3 worldPosition = effector.worldPosition;
					if (effector.positionWeight < 0.9999999f)
					{
						Vector3 a;
						if (internalValues.continuousSolverEnabled || internalValues.resetTransforms)
						{
							a = parentTransform * (effector._defaultPosition - rootBone._defaultPosition);
						}
						else
						{
							a = effector.bone_worldPosition;
						}
						Vector3 b = parentTransform * (beginLinkBone._defaultPosition - rootBone._defaultPosition);
						Vector3 a2 = a - b;
						Vector3 a3 = worldPosition - b;
						float magnitude = a3.magnitude;
						if (link0ToEffectorLength > 1E-07f && magnitude > 1E-07f)
						{
							Vector3 vector = a2 * (1f / link0ToEffectorLength);
							Vector3 vector2 = a3 * (1f / magnitude);
							Vector3 a4 = FullBodyIK._LerpDir(ref vector, ref vector2, effector.positionWeight);
							float d = Mathf.Lerp(link0ToEffectorLength, magnitude, Mathf.Clamp01(1f - (1f - effector.positionWeight) * 1.15f));
							return a4 * d + b;
						}
					}
					return worldPosition;
				}
				return Vector3.zero;
			}

			// Token: 0x0600085C RID: 2140 RVA: 0x0004D1B0 File Offset: 0x0004B3B0
			private bool _SolveNotThumb(int fingerType, ref FullBodyIK.Matrix3x4 parentTransform)
			{
				FullBodyIK.FingerIK._FingerBranch fingerBranch = this._fingerBranches[fingerType];
				if (fingerBranch == null || fingerBranch.fingerLinks.Length != 3)
				{
					return false;
				}
				bool flag = this._fingerIKType == FullBodyIK.FingerIKType.RightWrist;
				FullBodyIK.FingerIK._FingerLink fingerLink = fingerBranch.fingerLinks[0];
				FullBodyIK.FingerIK._FingerLink fingerLink2 = fingerBranch.fingerLinks[1];
				FullBodyIK.FingerIK._FingerLink fingerLink3 = fingerBranch.fingerLinks[2];
				FullBodyIK.Effector effector = fingerBranch.effector;
				float childToLength = fingerLink.childToLength;
				float childToLength2 = fingerLink2.childToLength;
				float childToLengthSq = fingerLink2.childToLengthSq;
				float childToLength3 = fingerLink3.childToLength;
				float childToLengthSq2 = fingerLink3.childToLengthSq;
				float link0ToEffectorLength = fingerBranch.link0ToEffectorLength;
				Vector3 vector = parentTransform * (fingerLink.bone._defaultPosition - this._parentBone._defaultPosition);
				Vector3 a = FullBodyIK.FingerIK._GetEffectorPosition(this._internalValues, this._parentBone, fingerLink.bone, effector, fingerBranch.link0ToEffectorLength, ref parentTransform);
				Vector3 vector2 = a - vector;
				float num = vector2.magnitude;
				if (num <= 1E-07f || link0ToEffectorLength <= 1E-07f)
				{
					return false;
				}
				Vector3 vector3 = vector2 * (1f / num);
				bool flag2 = (!flag) ? (fingerBranch.notThumb1BaseAngle.angle >= -1E-07f) : (fingerBranch.notThumb1BaseAngle.angle <= 1E-07f);
				float num2 = (!flag2) ? (childToLength + childToLength2 + childToLength3) : link0ToEffectorLength;
				if (num > num2)
				{
					num = num2;
					vector2 = vector3 * num;
					a = vector + vector2;
				}
				else if (num < childToLength2)
				{
					num = childToLength2;
					vector2 = vector3 * num;
					a = vector + vector2;
				}
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK.SAFBIKMatMult(out matrix3x, ref parentTransform.basis, ref fingerBranch.boneToSolvedBasis);
				Vector3 vector4;
				FullBodyIK.SAFBIKMatMultVecInv(out vector4, ref matrix3x, ref vector3);
				bool flag3 = vector4.y >= 0f;
				if (FullBodyIK._LimitFingerNotThumb(flag, ref vector4, ref this._notThumbPitchUThetaLimit, ref this._notThumbPitchLThetaLimit, ref this._notThumbYawThetaLimit))
				{
					FullBodyIK.SAFBIKMatMultVec(out vector3, ref matrix3x, ref vector4);
					vector2 = vector3 * num;
					a = vector + vector2;
				}
				Vector3 vector5 = Vector3.zero;
				Vector3 zero = Vector3.zero;
				if (!FullBodyIK.FingerIK._SolveInDirect(flag, ref vector5, ref zero, ref parentTransform.basis, ref fingerLink.boneToSolvedBasis, ref vector3))
				{
					return false;
				}
				bool flag4 = !flag2;
				if (flag2)
				{
					bool flag5 = false;
					float num3 = 0f;
					Vector3 vector6 = parentTransform * (fingerLink2.bone._defaultPosition - this._parentBone._defaultPosition);
					Vector3 vector7 = parentTransform * (fingerLink3.bone._defaultPosition - this._parentBone._defaultPosition);
					Vector3 a2 = parentTransform * (effector._defaultPosition - this._parentBone._defaultPosition);
					Vector3 vector8 = Vector3.zero;
					Vector3 vector9 = vector6 - vector;
					Vector3 vector10 = a2 - vector;
					FullBodyIK.Matrix3x3 matrix3x2;
					FullBodyIK.Matrix3x3 matrix3x3;
					FullBodyIK.Matrix3x3 matrix3x4;
					if (FullBodyIK.SAFBIKVecNormalize2(ref vector9, ref vector10) && FullBodyIK.SAFBIKComputeBasisFromXZLockX(out matrix3x2, (!flag) ? (-vector3) : vector3, zero) && FullBodyIK.SAFBIKComputeBasisFromXZLockZ(out matrix3x3, (!flag) ? (-vector9) : vector9, matrix3x2.column2) && FullBodyIK.SAFBIKComputeBasisFromXZLockZ(out matrix3x4, (!flag) ? (-vector10) : vector10, matrix3x2.column2))
					{
						Vector3 rhs = (!flag) ? (-matrix3x2.column0) : matrix3x2.column0;
						Vector3 column = matrix3x2.column1;
						Vector3 column2 = matrix3x2.column2;
						Vector3 vector11 = (!flag) ? (-matrix3x3.column0) : matrix3x3.column0;
						Vector3 column3 = matrix3x3.column1;
						Vector3 vector12 = (!flag) ? (-matrix3x4.column0) : matrix3x4.column0;
						Vector3 column4 = matrix3x4.column1;
						float cosR = Vector3.Dot(vector11, vector12);
						float sinR = Vector3.Dot(vector11, column4);
						Vector3 rhs2 = FullBodyIK._Rotate(ref rhs, ref column, cosR, sinR);
						flag5 = (Vector3.Dot(column4, rhs) >= 0f);
						bool flag6 = false;
						float num4 = Vector3.Dot(vector12, rhs);
						if (flag5)
						{
							if (flag2)
							{
								float angle = this._notThumb1PitchUTraceSmooth.angle;
								float cos = this._notThumb1PitchUTraceSmooth.cos;
								if (angle <= 1E-07f || num4 < cos)
								{
									Vector3 vector13 = Vector3.Cross(column2, rhs2);
									if (FullBodyIK.SAFBIKVecNormalize(ref vector13))
									{
										float cos2 = this._notThumb1PitchUTrace.cos;
										float sin = this._notThumb1PitchUTrace.sin;
										vector8 = FullBodyIK._Rotate(ref rhs2, ref vector13, cos2, (!flag) ? sin : (-sin));
									}
								}
								else
								{
									float num5 = FullBodyIK.SAFBIKAcos(num4);
									num5 /= angle;
									num5 = this._notThumb1PitchUTrace.angle * num5;
									vector8 = FullBodyIK._Rotate(ref vector11, ref column3, num5);
								}
							}
							else
							{
								flag4 = true;
							}
						}
						else if (flag2)
						{
							float num6 = Mathf.Abs(fingerBranch.notThumb1BaseAngle.angle);
							float num7 = Mathf.Max(num6, this._notThumb1PitchLTrace.angle);
							float num8 = Mathf.Min(fingerBranch.notThumb1BaseAngle.cos, this._notThumb1PitchLTrace.cos);
							if (num4 < num8)
							{
								flag4 = true;
								float num9 = childToLength3 * 0.25f;
								if (num >= link0ToEffectorLength - num9)
								{
									FullBodyIK.FingerIK._LerpEffectorLength(ref num, ref vector3, ref vector2, ref a, ref vector, link0ToEffectorLength - num9, childToLength + childToLength2 + childToLength3, num9);
								}
							}
							else if (num7 <= 1E-07f || num7 == num6)
							{
								vector8 = vector11;
								if (num7 <= 1E-07f)
								{
									num3 = 1f;
								}
								else
								{
									float num10 = FullBodyIK.SAFBIKAcos(num4);
									num3 = num10 / num7;
								}
							}
							else
							{
								float num11 = FullBodyIK.SAFBIKAcos(num4);
								num11 /= num7;
								num3 = num11;
								num11 = (this._notThumb1PitchLTrace.angle - num6) * num11;
								vector8 = FullBodyIK._Rotate(ref vector11, ref column3, -num11);
							}
						}
						else
						{
							flag4 = true;
						}
						if (flag2 && !flag4 && num < link0ToEffectorLength - 1E-07f)
						{
							float num12 = 0f;
							if (!flag6)
							{
								num12 = Vector3.Dot(vector8, rhs);
								num12 = FullBodyIK.SAFBIKSqrt(1f - num12 * num12);
								num12 *= childToLength;
							}
							float num13 = childToLength3 * 0.25f;
							if (num12 > 1E-07f && num >= link0ToEffectorLength - num12)
							{
								float num14 = 1f - (num - (link0ToEffectorLength - num12)) / num12;
								vector8 = FullBodyIK._FastLerpDir(ref vector8, ref rhs, num14);
								num3 += (1f - num3) * num14;
							}
							else
							{
								flag4 = true;
								if (num >= link0ToEffectorLength - (num12 + num13))
								{
									FullBodyIK.FingerIK._LerpEffectorLength(ref num, ref vector3, ref vector2, ref a, ref vector, link0ToEffectorLength - (num12 + num13), childToLength + childToLength2 + childToLength3, num13);
								}
							}
						}
					}
					if (!flag4)
					{
						if (vector8 == Vector3.zero)
						{
							return false;
						}
						if (!FullBodyIK.SAFBIKComputeBasisFromXZLockX(out fingerLink.boneTransform.basis, (!flag) ? (-vector8) : vector8, zero))
						{
							return false;
						}
						fingerLink.boneTransform.origin = vector;
						FullBodyIK.SAFBIKMatMultRet0(ref fingerLink.boneTransform.basis, ref fingerLink.solvedToBoneBasis);
						vector6 = fingerLink.boneTransform * (fingerLink2.bone._defaultPosition - fingerLink.bone._defaultPosition);
						vector7 = fingerLink.boneTransform * (fingerLink3.bone._defaultPosition - fingerLink.bone._defaultPosition);
						a2 = fingerLink.boneTransform * (effector._defaultPosition - fingerLink.bone._defaultPosition);
						Vector3 a3 = vector + vector3 * link0ToEffectorLength;
						Vector3 vector14 = a3 - vector6;
						Vector3 vector15 = vector7 - vector6;
						Vector3 vector16 = a2 - vector6;
						if (!FullBodyIK.SAFBIKVecNormalize3(ref vector14, ref vector15, ref vector16))
						{
							return false;
						}
						Vector3 vector17 = Vector3.zero;
						FullBodyIK.Matrix3x3 matrix3x5;
						if (!FullBodyIK.SAFBIKComputeBasisFromXZLockX(out matrix3x5, (!flag) ? (-vector14) : vector14, zero))
						{
							return false;
						}
						FullBodyIK.Matrix3x3 matrix3x6;
						FullBodyIK.Matrix3x3 matrix3x7;
						if (!FullBodyIK.SAFBIKComputeBasisFromXZLockZ(out matrix3x6, (!flag) ? (-vector15) : vector15, matrix3x5.column2) || !FullBodyIK.SAFBIKComputeBasisFromXZLockZ(out matrix3x7, (!flag) ? (-vector16) : vector16, matrix3x5.column2))
						{
							return false;
						}
						Vector3 vector18 = (!flag) ? (-matrix3x5.column0) : matrix3x5.column0;
						Vector3 column5 = matrix3x5.column1;
						Vector3 lhs = (!flag) ? (-matrix3x6.column0) : matrix3x6.column0;
						Vector3 rhs3 = (!flag) ? (-matrix3x7.column0) : matrix3x7.column0;
						Vector3 column6 = matrix3x7.column1;
						float cosR2 = Vector3.Dot(lhs, rhs3);
						float sinR2 = Vector3.Dot(lhs, column6);
						Vector3 vector19 = FullBodyIK._Rotate(ref vector18, ref column5, cosR2, sinR2);
						if (flag5)
						{
							vector17 = FullBodyIK._FastLerpDir(ref vector19, ref vector18, num3);
						}
						else
						{
							vector17 = FullBodyIK._FastLerpDir(ref lhs, ref vector18, num3);
						}
						if (!FullBodyIK.SAFBIKComputeBasisFromXZLockX(out fingerLink2.boneTransform.basis, (!flag) ? (-vector17) : vector17, zero))
						{
							return false;
						}
						fingerLink2.boneTransform.origin = vector6;
						FullBodyIK.SAFBIKMatMultRet0(ref fingerLink2.boneTransform.basis, ref fingerLink2.solvedToBoneBasis);
						vector7 = fingerLink2.boneTransform * (fingerLink3.bone._defaultPosition - fingerLink2.bone._defaultPosition);
						Vector3 vector20 = a3 - vector7;
						if (!FullBodyIK.SAFBIKVecNormalize(ref vector20))
						{
							return false;
						}
						Vector3 dirZ;
						FullBodyIK.SAFBIKMatMultVec(out dirZ, ref fingerLink2.boneTransform.basis, ref fingerLink3.boneToSolvedBasis.column2);
						if (!FullBodyIK.SAFBIKComputeBasisFromXZLockX(out fingerLink3.boneTransform.basis, (!flag) ? (-vector20) : vector20, dirZ))
						{
							return false;
						}
						fingerLink3.boneTransform.origin = vector7;
						FullBodyIK.SAFBIKMatMultRet0(ref fingerLink3.boneTransform.basis, ref fingerLink3.solvedToBoneBasis);
					}
				}
				if (flag4)
				{
					Vector3 vector21 = FullBodyIK.FingerIK.SolveFingerIK(ref vector, ref a, ref vector5, childToLength, childToLength2, childToLength3, ref fingerBranch.fingerIKParams);
					if (vector21 == Vector3.zero)
					{
						return false;
					}
					if (!flag3)
					{
						Vector3 dirX;
						FullBodyIK.SAFBIKMatMultVec(out dirX, ref parentTransform.basis, ref fingerLink.boneToSolvedBasis.column0);
						FullBodyIK.Matrix3x3 matrix3x8;
						if (FullBodyIK.SAFBIKComputeBasisFromXZLockZ(out matrix3x8, dirX, zero))
						{
							Vector3 vector22;
							FullBodyIK.SAFBIKMatMultVecInv(out vector22, ref matrix3x8, ref vector21);
							float x = vector22.x;
							float y = vector22.y;
							float z = vector22.z;
							float cos3 = this._notThumb1PitchLLimit.cos;
							if ((flag && x < cos3) || (!flag && x > -cos3))
							{
								float num15 = FullBodyIK.SAFBIKSqrt(1f - (cos3 * cos3 + z * z));
								vector22.x = ((!flag) ? (-cos3) : cos3);
								vector22.y = ((y < 0f) ? (-num15) : num15);
								FullBodyIK.SAFBIKMatMultVec(out vector21, ref matrix3x8, ref vector22);
							}
						}
					}
					if (!FullBodyIK.SAFBIKComputeBasisFromXZLockX(out fingerLink.boneTransform.basis, (!flag) ? (-vector21) : vector21, zero))
					{
						return false;
					}
					fingerLink.boneTransform.origin = vector;
					FullBodyIK.SAFBIKMatMultRet0(ref fingerLink.boneTransform.basis, ref fingerLink.solvedToBoneBasis);
					Vector3 vector23 = fingerLink.boneTransform * (fingerLink2.bone._defaultPosition - fingerLink.bone._defaultPosition);
					Vector3 rhs4 = a - vector23;
					Vector3 vector24;
					FullBodyIK.SAFBIKMatMultVec(out vector24, ref fingerLink.boneTransform.basis, ref this._internalValues.defaultRootBasis.column2);
					vector5 = Vector3.Cross(vector24, rhs4);
					if (!FullBodyIK.SAFBIKVecNormalize(ref vector5))
					{
						return false;
					}
					vector5 = ((!flag) ? (-vector5) : vector5);
					Vector3 vector25 = FullBodyIK.FingerIK.SolveLimbIK(ref vector23, ref a, childToLength2, childToLengthSq, childToLength3, childToLengthSq2, ref vector5);
					if (vector25 == Vector3.zero)
					{
						return false;
					}
					FullBodyIK.SAFBIKMatMultVec(out vector24, ref fingerLink.boneTransform.basis, ref fingerLink2.boneToSolvedBasis.column2);
					if (!FullBodyIK.SAFBIKComputeBasisFromXZLockX(out fingerLink2.boneTransform.basis, (!flag) ? (-vector25) : vector25, vector24))
					{
						return false;
					}
					fingerLink2.boneTransform.origin = vector23;
					FullBodyIK.SAFBIKMatMultRet0(ref fingerLink2.boneTransform.basis, ref fingerLink2.solvedToBoneBasis);
					Vector3 vector26 = fingerLink2.boneTransform * (fingerLink3.bone._defaultPosition - fingerLink2.bone._defaultPosition);
					Vector3 vector27 = a - vector26;
					if (!FullBodyIK.SAFBIKVecNormalize(ref vector27))
					{
						return false;
					}
					Vector3 dirZ2;
					FullBodyIK.SAFBIKMatMultVec(out dirZ2, ref fingerLink2.boneTransform.basis, ref fingerLink3.boneToSolvedBasis.column2);
					if (!FullBodyIK.SAFBIKComputeBasisFromXZLockX(out fingerLink3.boneTransform.basis, (!flag) ? (-vector27) : vector27, dirZ2))
					{
						return false;
					}
					fingerLink3.boneTransform.origin = vector26;
					FullBodyIK.SAFBIKMatMultRet0(ref fingerLink3.boneTransform.basis, ref fingerLink3.solvedToBoneBasis);
				}
				Quaternion worldRotation;
				FullBodyIK.SAFBIKMatMultGetRot(out worldRotation, ref fingerLink.boneTransform.basis, ref fingerLink.bone._defaultBasis);
				fingerLink.bone.worldRotation = worldRotation;
				FullBodyIK.SAFBIKMatMultGetRot(out worldRotation, ref fingerLink2.boneTransform.basis, ref fingerLink2.bone._defaultBasis);
				fingerLink2.bone.worldRotation = worldRotation;
				FullBodyIK.SAFBIKMatMultGetRot(out worldRotation, ref fingerLink3.boneTransform.basis, ref fingerLink3.bone._defaultBasis);
				fingerLink3.bone.worldRotation = worldRotation;
				return true;
			}

			// Token: 0x0600085D RID: 2141 RVA: 0x0004DFC0 File Offset: 0x0004C1C0
			private bool _SolveThumb(ref FullBodyIK.Matrix3x4 parentTransform)
			{
				FullBodyIK.FingerIK._FingerBranch fingerBranch = this._fingerBranches[0];
				if (fingerBranch == null || fingerBranch.fingerLinks.Length != 3)
				{
					return false;
				}
				FullBodyIK.FingerIK._FingerLink fingerLink = fingerBranch.fingerLinks[0];
				FullBodyIK.FingerIK._FingerLink fingerLink2 = fingerBranch.fingerLinks[1];
				FullBodyIK.FingerIK._FingerLink fingerLink3 = fingerBranch.fingerLinks[2];
				FullBodyIK.FingerIK._ThumbLink thumbLink = this._thumbBranch.thumbLinks[0];
				FullBodyIK.FingerIK._ThumbLink thumbLink2 = this._thumbBranch.thumbLinks[1];
				FullBodyIK.FingerIK._ThumbLink thumbLink3 = this._thumbBranch.thumbLinks[2];
				bool flag = this._fingerIKType == FullBodyIK.FingerIKType.RightWrist;
				Vector3 vector = parentTransform * (fingerLink.bone._defaultPosition - this._parentBone._defaultPosition);
				FullBodyIK.Effector effector = fingerBranch.effector;
				Vector3 a = FullBodyIK.FingerIK._GetEffectorPosition(this._internalValues, this._parentBone, fingerLink.bone, effector, fingerBranch.link0ToEffectorLength, ref parentTransform);
				Vector3 vector2 = a - vector;
				float num = vector2.magnitude;
				if (num < 1E-07f || fingerBranch.link0ToEffectorLength < 1E-07f)
				{
					return false;
				}
				Vector3 vector3 = vector2 * (1f / num);
				if (num > fingerBranch.link0ToEffectorLength)
				{
					num = fingerBranch.link0ToEffectorLength;
					vector2 = vector3 * fingerBranch.link0ToEffectorLength;
					a = vector + vector2;
				}
				Vector3 vector4 = vector3;
				if (this._thumbBranch.thumb0_isLimited)
				{
					FullBodyIK.Matrix3x3 matrix3x;
					FullBodyIK.SAFBIKMatMult(out matrix3x, ref parentTransform.basis, ref fingerBranch.boneToSolvedBasis);
					Vector3 vector5;
					FullBodyIK.SAFBIKMatMultVecInv(out vector5, ref matrix3x, ref vector4);
					if (FullBodyIK._LimitYZ(flag, ref vector5, this._thumbBranch.thumb0_lowerLimit, this._thumbBranch.thumb0_upperLimit, this._thumbBranch.thumb0_innerLimit, this._thumbBranch.thumb0_outerLimit))
					{
						FullBodyIK.SAFBIKMatMultVec(out vector4, ref matrix3x, ref vector5);
					}
				}
				Vector3 dirY;
				FullBodyIK.SAFBIKMatMultVec(out dirY, ref parentTransform.basis, ref thumbLink.thumb_boneToSolvedBasis.column1);
				if (!FullBodyIK.SAFBIKComputeBasisFromXYLockX(out fingerLink.boneTransform.basis, (!flag) ? (-vector4) : vector4, dirY))
				{
					return false;
				}
				fingerLink.boneTransform.origin = vector;
				FullBodyIK.SAFBIKMatMultRet0(ref fingerLink.boneTransform.basis, ref thumbLink.thumb_solvedToBoneBasis);
				Vector3 vector6 = fingerLink.boneTransform * (fingerLink2.bone._defaultPosition - fingerLink.bone._defaultPosition);
				float magnitude = (a - vector6).magnitude;
				if (magnitude < this._thumbBranch.linkLength1to3 - 1E-07f)
				{
					Vector3 a2 = a - fingerLink.boneTransform.origin;
					float num3;
					float num2 = FullBodyIK.SAFBIKVecLengthAndLengthSq(out num3, ref a2);
					float num4 = 1f;
					if (num2 > 1E-07f)
					{
						Vector3 rhs = vector6 - fingerLink.boneTransform.origin;
						if (FullBodyIK.SAFBIKVecNormalize(ref rhs))
						{
							Vector3 lhs = a2 * (1f / num2);
							num4 = Vector3.Dot(lhs, rhs);
						}
					}
					float linkLength0to = this._thumbBranch.linkLength0to1;
					float linkLength0to1Sq = this._thumbBranch.linkLength0to1Sq;
					float lenB = num2;
					float lenBSq = num3;
					float num5 = magnitude + (this._thumbBranch.linkLength1to3 - magnitude) * 0.5f;
					float lenCSq = num5 * num5;
					float num6 = FullBodyIK.FingerIK._ComputeTriangleTheta(linkLength0to, lenB, num5, linkLength0to1Sq, lenBSq, lenCSq);
					if (num6 < num4)
					{
						float num7 = FullBodyIK.SAFBIKAcos(num6) - FullBodyIK.SAFBIKAcos(num4);
						if (num7 > 0.00017453292f)
						{
							float num8 = linkLength0to1Sq * 2f;
							float num9 = FullBodyIK.SAFBIKSqrt(num8 * (1f - FullBodyIK.SAFBIKCos(num7)));
							if (num9 > 1E-07f)
							{
								Vector3 a3;
								FullBodyIK.SAFBIKMatMultVec(out a3, ref fingerLink.boneTransform.basis, ref this._thumbBranch.thumbSolveZ);
								vector6 += a3 * num9;
								Vector3 vector7 = vector6 - fingerLink.boneTransform.origin;
								if (FullBodyIK.SAFBIKVecNormalize(ref vector7))
								{
									Vector3 dirY2;
									FullBodyIK.SAFBIKMatMultVec(out dirY2, ref fingerLink.boneTransform.basis, ref fingerLink.boneToSolvedBasis.column1);
									FullBodyIK.Matrix3x3 matrix3x2;
									if (FullBodyIK.SAFBIKComputeBasisFromXYLockX(out matrix3x2, (!flag) ? (-vector7) : vector7, dirY2))
									{
										FullBodyIK.SAFBIKMatMult(out fingerLink.boneTransform.basis, ref matrix3x2, ref fingerLink.solvedToBoneBasis);
									}
								}
							}
						}
					}
				}
				Vector3 vector8 = fingerLink.boneTransform * (fingerLink2.bone._defaultPosition - fingerLink.bone._defaultPosition);
				Vector3 vector9 = a - vector8;
				if (!FullBodyIK.SAFBIKVecNormalize(ref vector9))
				{
					return false;
				}
				Vector3 dirY3;
				FullBodyIK.SAFBIKMatMultVec(out dirY3, ref fingerLink.boneTransform.basis, ref thumbLink2.thumb_boneToSolvedBasis.column1);
				if (!FullBodyIK.SAFBIKComputeBasisFromXYLockX(out fingerLink2.boneTransform.basis, (!flag) ? (-vector9) : vector9, dirY3))
				{
					return false;
				}
				fingerLink2.boneTransform.origin = vector8;
				FullBodyIK.SAFBIKMatMultRet0(ref fingerLink2.boneTransform.basis, ref thumbLink2.thumb_solvedToBoneBasis);
				float sqrMagnitude = (a - fingerLink2.boneTransform.origin).sqrMagnitude;
				float num10 = FullBodyIK.SAFBIKSqrt(sqrMagnitude);
				float linkLength1to = this._thumbBranch.linkLength1to2;
				float linkLength1to2Sq = this._thumbBranch.linkLength1to2Sq;
				float lenB2 = num10;
				float lenBSq2 = sqrMagnitude;
				float linkLength2to = this._thumbBranch.linkLength2to3;
				float linkLength2to3Sq = this._thumbBranch.linkLength2to3Sq;
				float num11 = FullBodyIK.FingerIK._ComputeTriangleTheta(linkLength1to, lenB2, linkLength2to, linkLength1to2Sq, lenBSq2, linkLength2to3Sq);
				if (num11 < this._thumbBranch.thumb1_baseThetaAtoB)
				{
					float num12 = FullBodyIK.SAFBIKAcos(num11) - this._thumbBranch.thumb1_Acos_baseThetaAtoB;
					if (num12 > 0.00017453292f)
					{
						float num13 = linkLength1to2Sq * 2f;
						float d = FullBodyIK.SAFBIKSqrt(num13 - num13 * FullBodyIK.SAFBIKCos(num12));
						Vector3 a4;
						FullBodyIK.SAFBIKMatMultVec(out a4, ref fingerLink2.boneTransform.basis, ref this._thumbBranch.thumbSolveZ);
						Vector3 a5 = fingerLink2.boneTransform * (fingerLink3.bone._defaultPosition - fingerLink2.bone._defaultPosition);
						a5 += a4 * d;
						Vector3 vector10 = a5 - fingerLink2.boneTransform.origin;
						if (FullBodyIK.SAFBIKVecNormalize(ref vector10))
						{
							Vector3 dirY4;
							FullBodyIK.SAFBIKMatMultVec(out dirY4, ref fingerLink2.boneTransform.basis, ref fingerLink2.boneToSolvedBasis.column1);
							FullBodyIK.Matrix3x3 matrix3x3;
							if (FullBodyIK.SAFBIKComputeBasisFromXYLockX(out matrix3x3, (!flag) ? (-vector10) : vector10, dirY4))
							{
								FullBodyIK.SAFBIKMatMult(out fingerLink2.boneTransform.basis, ref matrix3x3, ref fingerLink2.solvedToBoneBasis);
							}
						}
					}
				}
				Vector3 vector11 = fingerLink2.boneTransform * (fingerLink3.bone._defaultPosition - fingerLink2.bone._defaultPosition);
				Vector3 vector12 = a - vector11;
				if (!FullBodyIK.SAFBIKVecNormalize(ref vector12))
				{
					return false;
				}
				Vector3 dirY5;
				FullBodyIK.SAFBIKMatMultVec(out dirY5, ref fingerLink2.boneTransform.basis, ref thumbLink3.thumb_boneToSolvedBasis.column1);
				if (!FullBodyIK.SAFBIKComputeBasisFromXYLockX(out fingerLink3.boneTransform.basis, (!flag) ? (-vector12) : vector12, dirY5))
				{
					return false;
				}
				fingerLink3.boneTransform.origin = vector11;
				FullBodyIK.SAFBIKMatMultRet0(ref fingerLink3.boneTransform.basis, ref thumbLink3.thumb_solvedToBoneBasis);
				Quaternion worldRotation;
				FullBodyIK.SAFBIKMatMultGetRot(out worldRotation, ref fingerLink.boneTransform.basis, ref fingerLink.bone._defaultBasis);
				fingerLink.bone.worldRotation = worldRotation;
				FullBodyIK.SAFBIKMatMultGetRot(out worldRotation, ref fingerLink2.boneTransform.basis, ref fingerLink2.bone._defaultBasis);
				fingerLink2.bone.worldRotation = worldRotation;
				FullBodyIK.SAFBIKMatMultGetRot(out worldRotation, ref fingerLink3.boneTransform.basis, ref fingerLink3.bone._defaultBasis);
				fingerLink3.bone.worldRotation = worldRotation;
				return true;
			}

			// Token: 0x04000D54 RID: 3412
			private const float _positionLerpRate = 1.15f;

			// Token: 0x04000D55 RID: 3413
			private FullBodyIK.FingerIKType _fingerIKType;

			// Token: 0x04000D56 RID: 3414
			private FullBodyIK.Settings _settings;

			// Token: 0x04000D57 RID: 3415
			private FullBodyIK.InternalValues _internalValues;

			// Token: 0x04000D58 RID: 3416
			private FullBodyIK.Bone _parentBone;

			// Token: 0x04000D59 RID: 3417
			private FullBodyIK.FingerIK._FingerBranch[] _fingerBranches = new FullBodyIK.FingerIK._FingerBranch[5];

			// Token: 0x04000D5A RID: 3418
			private FullBodyIK.FingerIK._ThumbBranch _thumbBranch;

			// Token: 0x04000D5B RID: 3419
			private FullBodyIK.FastAngle _notThumbYawThetaLimit = new FullBodyIK.FastAngle(0.17453292f);

			// Token: 0x04000D5C RID: 3420
			private FullBodyIK.FastAngle _notThumbPitchUThetaLimit = new FullBodyIK.FastAngle(1.0471976f);

			// Token: 0x04000D5D RID: 3421
			private FullBodyIK.FastAngle _notThumbPitchLThetaLimit = new FullBodyIK.FastAngle(2.7925267f);

			// Token: 0x04000D5E RID: 3422
			private FullBodyIK.FastAngle _notThumb0FingerIKLimit = new FullBodyIK.FastAngle(1.0471976f);

			// Token: 0x04000D5F RID: 3423
			private FullBodyIK.FastAngle _notThumb1PitchUTrace = new FullBodyIK.FastAngle(0.08726646f);

			// Token: 0x04000D60 RID: 3424
			private FullBodyIK.FastAngle _notThumb1PitchUSmooth = new FullBodyIK.FastAngle(0.08726646f);

			// Token: 0x04000D61 RID: 3425
			private FullBodyIK.FastAngle _notThumb1PitchUTraceSmooth = new FullBodyIK.FastAngle(0.17453292f);

			// Token: 0x04000D62 RID: 3426
			private FullBodyIK.FastAngle _notThumb1PitchLTrace = new FullBodyIK.FastAngle(0.17453292f);

			// Token: 0x04000D63 RID: 3427
			private FullBodyIK.FastAngle _notThumb1PitchLLimit = new FullBodyIK.FastAngle(1.3962634f);

			// Token: 0x04000D64 RID: 3428
			private bool _isSyncDisplacementAtLeastOnce;

			// Token: 0x0200019A RID: 410
			public class _FingerLink
			{
				// Token: 0x04000D65 RID: 3429
				public FullBodyIK.Bone bone;

				// Token: 0x04000D66 RID: 3430
				public FullBodyIK.Matrix3x3 boneToSolvedBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000D67 RID: 3431
				public FullBodyIK.Matrix3x3 solvedToBoneBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000D68 RID: 3432
				public FullBodyIK.Matrix3x4 boneTransform = FullBodyIK.Matrix3x4.identity;

				// Token: 0x04000D69 RID: 3433
				public float childToLength;

				// Token: 0x04000D6A RID: 3434
				public float childToLengthSq;
			}

			// Token: 0x0200019B RID: 411
			public struct _FingerIKParams
			{
				// Token: 0x04000D6B RID: 3435
				public float lengthD0;

				// Token: 0x04000D6C RID: 3436
				public float lengthABCDInv;

				// Token: 0x04000D6D RID: 3437
				public float beginLink_endCosTheta;
			}

			// Token: 0x0200019C RID: 412
			public class _FingerBranch
			{
				// Token: 0x04000D6E RID: 3438
				public FullBodyIK.Effector effector;

				// Token: 0x04000D6F RID: 3439
				public FullBodyIK.FingerIK._FingerLink[] fingerLinks;

				// Token: 0x04000D70 RID: 3440
				public FullBodyIK.Matrix3x3 boneToSolvedBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000D71 RID: 3441
				public FullBodyIK.Matrix3x3 solvedToBoneBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000D72 RID: 3442
				public FullBodyIK.FastAngle notThumb1BaseAngle = default(FullBodyIK.FastAngle);

				// Token: 0x04000D73 RID: 3443
				public FullBodyIK.FastAngle notThumb2BaseAngle = default(FullBodyIK.FastAngle);

				// Token: 0x04000D74 RID: 3444
				public float link0ToEffectorLength;

				// Token: 0x04000D75 RID: 3445
				public float link0ToEffectorLengthSq;

				// Token: 0x04000D76 RID: 3446
				public FullBodyIK.FingerIK._FingerIKParams fingerIKParams = default(FullBodyIK.FingerIK._FingerIKParams);
			}

			// Token: 0x0200019D RID: 413
			private class _ThumbLink
			{
				// Token: 0x04000D77 RID: 3447
				public FullBodyIK.Matrix3x3 thumb_boneToSolvedBasis = FullBodyIK.Matrix3x3.identity;

				// Token: 0x04000D78 RID: 3448
				public FullBodyIK.Matrix3x3 thumb_solvedToBoneBasis = FullBodyIK.Matrix3x3.identity;
			}

			// Token: 0x0200019E RID: 414
			private class _ThumbBranch
			{
				// Token: 0x04000D79 RID: 3449
				public FullBodyIK.FingerIK._ThumbLink[] thumbLinks;

				// Token: 0x04000D7A RID: 3450
				public Vector3 thumbSolveY = Vector3.zero;

				// Token: 0x04000D7B RID: 3451
				public Vector3 thumbSolveZ = Vector3.zero;

				// Token: 0x04000D7C RID: 3452
				public bool thumb0_isLimited;

				// Token: 0x04000D7D RID: 3453
				public float thumb0_lowerLimit;

				// Token: 0x04000D7E RID: 3454
				public float thumb0_upperLimit;

				// Token: 0x04000D7F RID: 3455
				public float thumb0_innerLimit;

				// Token: 0x04000D80 RID: 3456
				public float thumb0_outerLimit;

				// Token: 0x04000D81 RID: 3457
				public float linkLength0to1Sq;

				// Token: 0x04000D82 RID: 3458
				public float linkLength0to1;

				// Token: 0x04000D83 RID: 3459
				public float linkLength1to3Sq;

				// Token: 0x04000D84 RID: 3460
				public float linkLength1to3;

				// Token: 0x04000D85 RID: 3461
				public float linkLength1to2Sq;

				// Token: 0x04000D86 RID: 3462
				public float linkLength1to2;

				// Token: 0x04000D87 RID: 3463
				public float linkLength2to3Sq;

				// Token: 0x04000D88 RID: 3464
				public float linkLength2to3;

				// Token: 0x04000D89 RID: 3465
				public float thumb1_baseThetaAtoB = 1f;

				// Token: 0x04000D8A RID: 3466
				public float thumb1_Acos_baseThetaAtoB;
			}
		}

		// Token: 0x0200019F RID: 415
		public class HeadIK
		{
			// Token: 0x06000862 RID: 2146 RVA: 0x0004E838 File Offset: 0x0004CA38
			public HeadIK(FullBodyIK fullBodyIK)
			{
				this._settings = fullBodyIK.settings;
				this._internalValues = fullBodyIK.internalValues;
				this._neckBone = FullBodyIK._PrepareBone(fullBodyIK.headBones.neck);
				this._headBone = FullBodyIK._PrepareBone(fullBodyIK.headBones.head);
				this._leftEyeBone = FullBodyIK._PrepareBone(fullBodyIK.headBones.leftEye);
				this._rightEyeBone = FullBodyIK._PrepareBone(fullBodyIK.headBones.rightEye);
				this._headEffector = fullBodyIK.headEffectors.head;
				this._eyesEffector = fullBodyIK.headEffectors.eyes;
			}

			// Token: 0x06000863 RID: 2147 RVA: 0x0004E900 File Offset: 0x0004CB00
			private void _SyncDisplacement(FullBodyIK fullBodyIK)
			{
				if (this._settings.syncDisplacement == FullBodyIK.SyncDisplacement.Everyframe || !this._isSyncDisplacementAtLeastOnce)
				{
					this._isSyncDisplacementAtLeastOnce = true;
					if (this._headBone != null && this._headBone.transformIsAlive)
					{
						if (this._headEffector != null)
						{
							FullBodyIK.SAFBIKQuatMultInv0(out this._headEffectorToWorldRotation, ref this._headEffector._defaultRotation, ref this._headBone._defaultRotation);
						}
						if (this._leftEyeBone != null && this._leftEyeBone.transformIsAlive)
						{
							FullBodyIK.SAFBIKQuatMultInv0(out this._headToLeftEyeRotation, ref this._headBone._defaultRotation, ref this._leftEyeBone._defaultRotation);
						}
						if (this._rightEyeBone != null && this._rightEyeBone.transformIsAlive)
						{
							FullBodyIK.SAFBIKQuatMultInv0(out this._headToRightEyeRotation, ref this._headBone._defaultRotation, ref this._rightEyeBone._defaultRotation);
						}
					}
					this._isEnabledCustomEyes = fullBodyIK._PrepareCustomEyes(ref this._headToLeftEyeRotation, ref this._headToRightEyeRotation);
				}
			}

			// Token: 0x06000864 RID: 2148 RVA: 0x0004EA08 File Offset: 0x0004CC08
			public bool Solve(FullBodyIK fullBodyIK)
			{
				if (this._neckBone == null || !this._neckBone.transformIsAlive || this._headBone == null || !this._headBone.transformIsAlive || this._headBone.parentBone == null || !this._headBone.parentBone.transformIsAlive)
				{
					return false;
				}
				this._SyncDisplacement(fullBodyIK);
				float num = (!this._headEffector.positionEnabled) ? 0f : this._headEffector.positionWeight;
				float num2 = (!this._eyesEffector.positionEnabled) ? 0f : this._eyesEffector.positionWeight;
				if (num <= 1E-07f && num2 <= 1E-07f)
				{
					Quaternion worldRotation = this._neckBone.parentBone.worldRotation;
					Quaternion quaternion;
					FullBodyIK.SAFBIKQuatMult(out quaternion, ref worldRotation, ref this._neckBone.parentBone._worldToBaseRotation);
					if (this._internalValues.resetTransforms)
					{
						Quaternion worldRotation2;
						FullBodyIK.SAFBIKQuatMult(out worldRotation2, ref quaternion, ref this._neckBone._baseToWorldRotation);
						this._neckBone.worldRotation = worldRotation2;
					}
					float num3 = (!this._headEffector.rotationEnabled) ? 0f : this._headEffector.rotationWeight;
					if (num3 > 1E-07f)
					{
						Quaternion worldRotation3 = this._headEffector.worldRotation;
						Quaternion quaternion2;
						FullBodyIK.SAFBIKQuatMult(out quaternion2, ref worldRotation3, ref this._headEffectorToWorldRotation);
						if (num3 < 0.9999999f)
						{
							Quaternion worldRotation4;
							if (this._internalValues.resetTransforms)
							{
								FullBodyIK.SAFBIKQuatMult(out worldRotation4, ref quaternion, ref this._headBone._baseToWorldRotation);
							}
							else
							{
								worldRotation4 = this._headBone.worldRotation;
							}
							this._headBone.worldRotation = Quaternion.Lerp(worldRotation4, quaternion2, num3);
						}
						else
						{
							this._headBone.worldRotation = quaternion2;
						}
						this._HeadRotationLimit();
					}
					else if (this._internalValues.resetTransforms)
					{
						Quaternion worldRotation5;
						FullBodyIK.SAFBIKQuatMult(out worldRotation5, ref quaternion, ref this._headBone._baseToWorldRotation);
						this._headBone.worldRotation = worldRotation5;
					}
					if (this._internalValues.resetTransforms)
					{
						if (this._isEnabledCustomEyes)
						{
							fullBodyIK._ResetCustomEyes();
						}
						else
						{
							this._ResetEyes();
						}
					}
					return this._internalValues.resetTransforms || num3 > 1E-07f;
				}
				this._Solve(fullBodyIK);
				return true;
			}

			// Token: 0x06000865 RID: 2149 RVA: 0x0004EC7C File Offset: 0x0004CE7C
			private void _HeadRotationLimit()
			{
				Quaternion worldRotation = this._headBone.worldRotation;
				Quaternion worldRotation2;
				FullBodyIK.SAFBIKQuatMult(out worldRotation2, ref worldRotation, ref this._headBone._worldToBaseRotation);
				worldRotation = this._neckBone.worldRotation;
				Quaternion quaternion;
				FullBodyIK.SAFBIKQuatMult(out quaternion, ref worldRotation, ref this._neckBone._worldToBaseRotation);
				Quaternion quaternion2;
				FullBodyIK.SAFBIKQuatMultInv0(out quaternion2, ref quaternion, ref worldRotation2);
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK.SAFBIKMatSetRot(out matrix3x, ref quaternion2);
				Vector3 column = matrix3x.column1;
				Vector3 column2 = matrix3x.column2;
				bool flag = false;
				flag |= FullBodyIK._LimitXZ_Square(ref column, this._internalValues.headIK.headLimitRollTheta.sin, this._internalValues.headIK.headLimitRollTheta.sin, this._internalValues.headIK.headLimitPitchUpTheta.sin, this._internalValues.headIK.headLimitPitchDownTheta.sin);
				flag |= FullBodyIK._LimitXY_Square(ref column2, this._internalValues.headIK.headLimitYawTheta.sin, this._internalValues.headIK.headLimitYawTheta.sin, this._internalValues.headIK.headLimitPitchDownTheta.sin, this._internalValues.headIK.headLimitPitchUpTheta.sin);
				if (flag && FullBodyIK.SAFBIKComputeBasisFromYZLockZ(out matrix3x, ref column, ref column2))
				{
					FullBodyIK.SAFBIKMatGetRot(out quaternion2, ref matrix3x);
					FullBodyIK.SAFBIKQuatMultNorm3(out worldRotation2, ref quaternion, ref quaternion2, ref this._headBone._baseToWorldRotation);
					this._headBone.worldRotation = worldRotation2;
				}
			}

			// Token: 0x06000866 RID: 2150 RVA: 0x0004EDF4 File Offset: 0x0004CFF4
			private void _Solve(FullBodyIK fullBodyIK)
			{
				Quaternion worldRotation = this._neckBone.parentBone.worldRotation;
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK.SAFBIKMatSetRotMultInv1(out matrix3x, ref worldRotation, ref this._neckBone.parentBone._defaultRotation);
				FullBodyIK.Matrix3x3 matrix3x2;
				FullBodyIK.SAFBIKMatMult(out matrix3x2, ref matrix3x, ref this._internalValues.defaultRootBasis);
				Quaternion quaternion;
				FullBodyIK.SAFBIKQuatMult(out quaternion, ref worldRotation, ref this._neckBone.parentBone._worldToBaseRotation);
				float num = (!this._headEffector.positionEnabled) ? 0f : this._headEffector.positionWeight;
				float num2 = (!this._eyesEffector.positionEnabled) ? 0f : this._eyesEffector.positionWeight;
				Quaternion quaternion2 = Quaternion.identity;
				Quaternion quaternion3 = Quaternion.identity;
				Quaternion quaternion4 = Quaternion.identity;
				Quaternion quaternion5 = Quaternion.identity;
				if (!this._internalValues.resetTransforms)
				{
					quaternion2 = this._neckBone.worldRotation;
					quaternion3 = this._headBone.worldRotation;
					if (this._leftEyeBone != null && this._leftEyeBone.transformIsAlive)
					{
						quaternion4 = this._leftEyeBone.worldRotation;
					}
					if (this._rightEyeBone != null && this._rightEyeBone.transformIsAlive)
					{
						quaternion5 = this._rightEyeBone.worldRotation;
					}
				}
				if (num > 1E-07f)
				{
					FullBodyIK.Matrix3x3 matrix3x3;
					FullBodyIK.SAFBIKMatMult(out matrix3x3, ref matrix3x, ref this._neckBone._localAxisBasis);
					Vector3 vector = this._headEffector.worldPosition - this._neckBone.worldPosition;
					if (FullBodyIK.SAFBIKVecNormalize(ref vector))
					{
						Vector3 vector2;
						FullBodyIK.SAFBIKMatMultVecInv(out vector2, ref matrix3x3, ref vector);
						if (FullBodyIK._LimitXZ_Square(ref vector2, this._internalValues.headIK.neckLimitRollTheta.sin, this._internalValues.headIK.neckLimitRollTheta.sin, this._internalValues.headIK.neckLimitPitchDownTheta.sin, this._internalValues.headIK.neckLimitPitchUpTheta.sin))
						{
							FullBodyIK.SAFBIKMatMultVec(out vector, ref matrix3x3, ref vector2);
						}
						Vector3 column = matrix3x2.column0;
						Vector3 column2 = matrix3x2.column2;
						if (FullBodyIK.SAFBIKComputeBasisLockY(out matrix3x3, ref column, ref vector, ref column2))
						{
							Quaternion quaternion6;
							FullBodyIK.SAFBIKMatMultGetRot(out quaternion6, ref matrix3x3, ref this._neckBone._boneToWorldBasis);
							if (num < 0.9999999f)
							{
								Quaternion a;
								if (this._internalValues.resetTransforms)
								{
									FullBodyIK.SAFBIKQuatMult(out a, ref quaternion, ref this._neckBone._baseToWorldRotation);
								}
								else
								{
									a = quaternion2;
								}
								this._neckBone.worldRotation = Quaternion.Lerp(a, quaternion6, num);
							}
							else
							{
								this._neckBone.worldRotation = quaternion6;
							}
						}
					}
				}
				else if (this._internalValues.resetTransforms)
				{
					Quaternion worldRotation2;
					FullBodyIK.SAFBIKQuatMult(out worldRotation2, ref quaternion, ref this._neckBone._baseToWorldRotation);
					this._neckBone.worldRotation = worldRotation2;
				}
				if (num2 <= 1E-07f)
				{
					float num3 = (!this._headEffector.rotationEnabled) ? 0f : this._headEffector.rotationWeight;
					if (num3 > 1E-07f)
					{
						Quaternion worldRotation3 = this._headEffector.worldRotation;
						Quaternion quaternion7;
						FullBodyIK.SAFBIKQuatMult(out quaternion7, ref worldRotation3, ref this._headEffectorToWorldRotation);
						if (num3 < 0.9999999f)
						{
							Quaternion worldRotation4 = this._neckBone.worldRotation;
							Quaternion a2;
							if (this._internalValues.resetTransforms)
							{
								FullBodyIK.SAFBIKQuatMult3(out a2, ref worldRotation4, ref this._neckBone._worldToBaseRotation, ref this._headBone._baseToWorldRotation);
							}
							else
							{
								FullBodyIK.SAFBIKQuatMultNorm3Inv1(out a2, ref worldRotation4, ref quaternion2, ref quaternion3);
							}
							this._headBone.worldRotation = Quaternion.Lerp(a2, quaternion7, num3);
						}
						else
						{
							this._headBone.worldRotation = quaternion7;
						}
					}
					else if (this._internalValues.resetTransforms)
					{
						Quaternion worldRotation5 = this._neckBone.worldRotation;
						Quaternion worldRotation6;
						FullBodyIK.SAFBIKQuatMult3(out worldRotation6, ref worldRotation5, ref this._neckBone._worldToBaseRotation, ref this._headBone._baseToWorldRotation);
						this._headBone.worldRotation = worldRotation6;
					}
					this._HeadRotationLimit();
					if (this._internalValues.resetTransforms)
					{
						if (this._isEnabledCustomEyes)
						{
							fullBodyIK._ResetCustomEyes();
						}
						else
						{
							this._ResetEyes();
						}
					}
					return;
				}
				Vector3 worldPosition = this._neckBone.parentBone.worldPosition;
				Vector3 b;
				FullBodyIK.SAFBIKMatMultVecPreSubAdd(out b, ref matrix3x, ref this._eyesEffector._defaultPosition, ref this._neckBone.parentBone._defaultPosition, ref worldPosition);
				Vector3 vector3 = this._eyesEffector.worldPosition - b;
				FullBodyIK.Matrix3x3 matrix3x4 = matrix3x2;
				Vector3 vector4;
				FullBodyIK.SAFBIKMatMultVecInv(out vector4, ref matrix3x2, ref vector3);
				vector4.y *= this._settings.headIK.eyesToNeckPitchRate;
				FullBodyIK.SAFBIKVecNormalize(ref vector4);
				if (FullBodyIK._ComputeEyesRange(ref vector4, this._internalValues.headIK.eyesTraceTheta.cos))
				{
					if (vector4.y < -this._internalValues.headIK.neckLimitPitchDownTheta.sin)
					{
						vector4.y = -this._internalValues.headIK.neckLimitPitchDownTheta.sin;
					}
					else if (vector4.y > this._internalValues.headIK.neckLimitPitchUpTheta.sin)
					{
						vector4.y = this._internalValues.headIK.neckLimitPitchUpTheta.sin;
					}
					vector4.x = 0f;
					vector4.z = FullBodyIK.SAFBIKSqrt(1f - vector4.y * vector4.y);
				}
				FullBodyIK.SAFBIKMatMultVec(out vector3, ref matrix3x2, ref vector4);
				Vector3 column3 = matrix3x2.column0;
				Vector3 column4 = matrix3x2.column1;
				Vector3 vector5 = vector3;
				if (!FullBodyIK.SAFBIKComputeBasisLockZ(out matrix3x4, ref column3, ref column4, ref vector5))
				{
					matrix3x4 = matrix3x2;
				}
				Quaternion quaternion8;
				FullBodyIK.SAFBIKMatMultGetRot(out quaternion8, ref matrix3x4, ref this._neckBone._baseToWorldBasis);
				if (this._eyesEffector.positionWeight < 0.9999999f)
				{
					Quaternion worldRotation7 = Quaternion.Lerp(this._neckBone.worldRotation, quaternion8, this._eyesEffector.positionWeight);
					this._neckBone.worldRotation = worldRotation7;
					FullBodyIK.SAFBIKMatSetRotMult(out matrix3x4, ref worldRotation7, ref this._neckBone._worldToBaseRotation);
				}
				else
				{
					this._neckBone.worldRotation = quaternion8;
				}
				FullBodyIK.Matrix3x3 matrix3x5;
				FullBodyIK.SAFBIKMatMult(out matrix3x5, ref matrix3x4, ref this._internalValues.defaultRootBasisInv);
				Vector3 worldPosition2 = this._neckBone.worldPosition;
				FullBodyIK.SAFBIKMatMultVecPreSubAdd(out b, ref matrix3x5, ref this._eyesEffector._defaultPosition, ref this._neckBone._defaultPosition, ref worldPosition2);
				vector3 = this._eyesEffector.worldPosition - b;
				FullBodyIK.Matrix3x3 matrix3x6 = matrix3x4;
				Vector3 vector6;
				FullBodyIK.SAFBIKMatMultVecInv(out vector6, ref matrix3x4, ref vector3);
				vector6.x *= this._settings.headIK.eyesToHeadYawRate;
				vector6.y *= this._settings.headIK.eyesToHeadPitchRate;
				FullBodyIK.SAFBIKVecNormalize(ref vector6);
				if (FullBodyIK._ComputeEyesRange(ref vector6, this._internalValues.headIK.eyesTraceTheta.cos))
				{
					FullBodyIK._LimitXY_Square(ref vector6, this._internalValues.headIK.headLimitYawTheta.sin, this._internalValues.headIK.headLimitYawTheta.sin, this._internalValues.headIK.headLimitPitchDownTheta.sin, this._internalValues.headIK.headLimitPitchUpTheta.sin);
				}
				FullBodyIK.SAFBIKMatMultVec(out vector3, ref matrix3x4, ref vector6);
				Vector3 column5 = matrix3x4.column0;
				Vector3 column6 = matrix3x4.column1;
				Vector3 vector7 = vector3;
				if (!FullBodyIK.SAFBIKComputeBasisLockZ(out matrix3x6, ref column5, ref column6, ref vector7))
				{
					matrix3x6 = matrix3x4;
				}
				Quaternion quaternion9;
				FullBodyIK.SAFBIKMatMultGetRot(out quaternion9, ref matrix3x6, ref this._headBone._baseToWorldBasis);
				if (this._eyesEffector.positionWeight < 0.9999999f)
				{
					Quaternion worldRotation8 = this._neckBone.worldRotation;
					Quaternion a3;
					FullBodyIK.SAFBIKQuatMultNorm3Inv1(out a3, ref worldRotation8, ref quaternion2, ref quaternion3);
					Quaternion worldRotation9 = Quaternion.Lerp(a3, quaternion9, this._eyesEffector.positionWeight);
					this._headBone.worldRotation = worldRotation9;
					FullBodyIK.SAFBIKMatSetRotMult(out matrix3x6, ref worldRotation9, ref this._headBone._worldToBaseRotation);
				}
				else
				{
					this._headBone.worldRotation = quaternion9;
				}
				FullBodyIK.Matrix3x3 matrix3x7;
				FullBodyIK.SAFBIKMatMult(out matrix3x7, ref matrix3x6, ref this._internalValues.defaultRootBasisInv);
				if (this._isEnabledCustomEyes)
				{
					fullBodyIK._SolveCustomEyes(ref matrix3x5, ref matrix3x7, ref matrix3x6);
				}
				else
				{
					this._SolveEyes(ref matrix3x5, ref matrix3x7, ref matrix3x6, ref quaternion3, ref quaternion4, ref quaternion5);
				}
			}

			// Token: 0x06000867 RID: 2151 RVA: 0x0004F654 File Offset: 0x0004D854
			private void _ResetEyes()
			{
				if (this._headBone != null && this._headBone.transformIsAlive)
				{
					Quaternion worldRotation = this._headBone.worldRotation;
					if (this._leftEyeBone != null && this._leftEyeBone.transformIsAlive)
					{
						Quaternion worldRotation2;
						FullBodyIK.SAFBIKQuatMultNorm(out worldRotation2, ref worldRotation, ref this._headToLeftEyeRotation);
						this._leftEyeBone.worldRotation = worldRotation2;
					}
					if (this._rightEyeBone != null && this._rightEyeBone.transformIsAlive)
					{
						Quaternion worldRotation2;
						FullBodyIK.SAFBIKQuatMultNorm(out worldRotation2, ref worldRotation, ref this._headToRightEyeRotation);
						this._rightEyeBone.worldRotation = worldRotation2;
					}
				}
			}

			// Token: 0x06000868 RID: 2152 RVA: 0x0004F6F4 File Offset: 0x0004D8F4
			private void _SolveEyes(ref FullBodyIK.Matrix3x3 neckBasis, ref FullBodyIK.Matrix3x3 headBasis, ref FullBodyIK.Matrix3x3 headBaseBasis, ref Quaternion headPrevRotation, ref Quaternion leftEyePrevRotation, ref Quaternion rightEyePrevRotation)
			{
				if (this._headBone != null && this._headBone.transformIsAlive && ((this._leftEyeBone != null && this._leftEyeBone.transformIsAlive) || (this._rightEyeBone != null && this._rightEyeBone.transformIsAlive)))
				{
					Vector3 worldPosition = this._neckBone.worldPosition;
					Vector3 vector;
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out vector, ref neckBasis, ref this._headBone._defaultPosition, ref this._neckBone._defaultPosition, ref worldPosition);
					Vector3 b;
					FullBodyIK.SAFBIKMatMultVecPreSubAdd(out b, ref headBasis, ref this._eyesEffector._defaultPosition, ref this._headBone._defaultPosition, ref vector);
					Vector3 vector2 = this._eyesEffector.worldPosition - b;
					FullBodyIK.SAFBIKMatMultVecInv(out vector2, ref headBaseBasis, ref vector2);
					FullBodyIK.SAFBIKVecNormalize(ref vector2);
					if (this._internalValues.resetTransforms && this._eyesEffector.positionWeight < 0.9999999f)
					{
						Vector3 vector3 = Vector3.Lerp(new Vector3(0f, 0f, 1f), vector2, this._eyesEffector.positionWeight);
						if (FullBodyIK.SAFBIKVecNormalize(ref vector3))
						{
							vector2 = vector3;
						}
					}
					FullBodyIK._LimitXY_Square(ref vector2, this._internalValues.headIK.eyesLimitYawTheta.sin, this._internalValues.headIK.eyesLimitYawTheta.sin, this._internalValues.headIK.eyesLimitPitchTheta.sin, this._internalValues.headIK.eyesLimitPitchTheta.sin);
					vector2.x *= this._settings.headIK.eyesYawRate;
					vector2.y *= this._settings.headIK.eyesPitchRate;
					Vector3 vector4 = vector2;
					Vector3 vector5 = vector2;
					if (vector2.x >= 0f)
					{
						vector4.x *= this._settings.headIK.eyesYawInnerRate;
						vector5.x *= this._settings.headIK.eyesYawOuterRate;
					}
					else
					{
						vector4.x *= this._settings.headIK.eyesYawOuterRate;
						vector5.x *= this._settings.headIK.eyesYawInnerRate;
					}
					FullBodyIK.SAFBIKVecNormalize2(ref vector4, ref vector5);
					FullBodyIK.SAFBIKMatMultVec(out vector4, ref headBaseBasis, ref vector4);
					FullBodyIK.SAFBIKMatMultVec(out vector5, ref headBaseBasis, ref vector5);
					Quaternion worldRotation = this._headBone.worldRotation;
					if (this._leftEyeBone != null && this._leftEyeBone.transformIsAlive)
					{
						FullBodyIK.Matrix3x3 matrix3x;
						FullBodyIK.SAFBIKComputeBasisLockZ(out matrix3x, ref headBasis.column0, ref headBasis.column1, ref vector4);
						Quaternion quaternion;
						FullBodyIK.SAFBIKMatMultGetRot(out quaternion, ref matrix3x, ref this._leftEyeBone._baseToWorldBasis);
						if (!this._internalValues.resetTransforms && this._eyesEffector.positionWeight < 0.9999999f)
						{
							Quaternion a;
							FullBodyIK.SAFBIKQuatMultNorm3Inv1(out a, ref worldRotation, ref headPrevRotation, ref leftEyePrevRotation);
							this._leftEyeBone.worldRotation = Quaternion.Lerp(a, quaternion, this._eyesEffector.positionWeight);
						}
						else
						{
							this._leftEyeBone.worldRotation = quaternion;
						}
					}
					if (this._rightEyeBone != null && this._rightEyeBone.transformIsAlive)
					{
						FullBodyIK.Matrix3x3 matrix3x2;
						FullBodyIK.SAFBIKComputeBasisLockZ(out matrix3x2, ref headBasis.column0, ref headBasis.column1, ref vector5);
						Quaternion quaternion;
						FullBodyIK.SAFBIKMatMultGetRot(out quaternion, ref matrix3x2, ref this._rightEyeBone._baseToWorldBasis);
						if (!this._internalValues.resetTransforms && this._eyesEffector.positionWeight < 0.9999999f)
						{
							Quaternion a2;
							FullBodyIK.SAFBIKQuatMultNorm3Inv1(out a2, ref worldRotation, ref headPrevRotation, ref rightEyePrevRotation);
							this._rightEyeBone.worldRotation = Quaternion.Lerp(a2, quaternion, this._eyesEffector.positionWeight);
						}
						else
						{
							this._rightEyeBone.worldRotation = quaternion;
						}
					}
				}
			}

			// Token: 0x04000D8B RID: 3467
			private FullBodyIK.Settings _settings;

			// Token: 0x04000D8C RID: 3468
			private FullBodyIK.InternalValues _internalValues;

			// Token: 0x04000D8D RID: 3469
			private FullBodyIK.Bone _neckBone;

			// Token: 0x04000D8E RID: 3470
			private FullBodyIK.Bone _headBone;

			// Token: 0x04000D8F RID: 3471
			private FullBodyIK.Bone _leftEyeBone;

			// Token: 0x04000D90 RID: 3472
			private FullBodyIK.Bone _rightEyeBone;

			// Token: 0x04000D91 RID: 3473
			private FullBodyIK.Effector _headEffector;

			// Token: 0x04000D92 RID: 3474
			private FullBodyIK.Effector _eyesEffector;

			// Token: 0x04000D93 RID: 3475
			private Quaternion _headEffectorToWorldRotation = Quaternion.identity;

			// Token: 0x04000D94 RID: 3476
			private Quaternion _headToLeftEyeRotation = Quaternion.identity;

			// Token: 0x04000D95 RID: 3477
			private Quaternion _headToRightEyeRotation = Quaternion.identity;

			// Token: 0x04000D96 RID: 3478
			private bool _isSyncDisplacementAtLeastOnce;

			// Token: 0x04000D97 RID: 3479
			private bool _isEnabledCustomEyes;
		}

		// Token: 0x020001A0 RID: 416
		public class LimbIK
		{
			// Token: 0x06000869 RID: 2153 RVA: 0x0004FAC4 File Offset: 0x0004DCC4
			public LimbIK(FullBodyIK fullBodyIK, FullBodyIK.LimbIKLocation limbIKLocation)
			{
				if (fullBodyIK == null)
				{
					return;
				}
				this._settings = fullBodyIK.settings;
				this._internalValues = fullBodyIK.internalValues;
				this._limbIKLocation = limbIKLocation;
				this._limbIKType = FullBodyIK.ToLimbIKType(limbIKLocation);
				this._limbIKSide = FullBodyIK.ToLimbIKSide(limbIKLocation);
				if (this._limbIKType == FullBodyIK.LimbIKType.Leg)
				{
					FullBodyIK.LegBones legBones = (this._limbIKSide != FullBodyIK.Side.Left) ? fullBodyIK.rightLegBones : fullBodyIK.leftLegBones;
					FullBodyIK.LegEffectors legEffectors = (this._limbIKSide != FullBodyIK.Side.Left) ? fullBodyIK.rightLegEffectors : fullBodyIK.leftLegEffectors;
					this._beginBone = legBones.leg;
					this._bendingBone = legBones.knee;
					this._endBone = legBones.foot;
					this._bendingEffector = legEffectors.knee;
					this._endEffector = legEffectors.foot;
				}
				else if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					FullBodyIK.ArmBones armBones = (this._limbIKSide != FullBodyIK.Side.Left) ? fullBodyIK.rightArmBones : fullBodyIK.leftArmBones;
					FullBodyIK.ArmEffectors armEffectors = (this._limbIKSide != FullBodyIK.Side.Left) ? fullBodyIK.rightArmEffectors : fullBodyIK.leftArmEffectors;
					this._beginBone = armBones.arm;
					this._bendingBone = armBones.elbow;
					this._endBone = armBones.wrist;
					this._bendingEffector = armEffectors.elbow;
					this._endEffector = armEffectors.wrist;
					FullBodyIK.LimbIK._PrepareRollBones(ref this._armRollBones, armBones.armRoll);
					FullBodyIK.LimbIK._PrepareRollBones(ref this._elbowRollBones, armBones.elbowRoll);
				}
				this._Prepare(fullBodyIK);
			}

			// Token: 0x0600086A RID: 2154 RVA: 0x0004FD0C File Offset: 0x0004DF0C
			private void _Prepare(FullBodyIK fullBodyIK)
			{
				FullBodyIK.SAFBIKQuatMultInv0(out this._endEffectorToWorldRotation, ref this._endEffector._defaultRotation, ref this._endBone._defaultRotation);
				this._beginToBendingLength = this._bendingBone._defaultLocalLength.length;
				this._beginToBendingLengthSq = this._bendingBone._defaultLocalLength.lengthSq;
				this._bendingToEndLength = this._endBone._defaultLocalLength.length;
				this._bendingToEndLengthSq = this._endBone._defaultLocalLength.lengthSq;
				float lenBSq;
				float lenB = FullBodyIK.SAFBIKVecLengthAndLengthSq2(out lenBSq, ref this._endBone._defaultPosition, ref this._beginBone._defaultPosition);
				this._defaultCosTheta = FullBodyIK.ComputeCosTheta(this._bendingToEndLengthSq, lenBSq, this._beginToBendingLengthSq, lenB, this._beginToBendingLength);
				this._defaultSinTheta = FullBodyIK.SAFBIKSqrtClamp01(1f - this._defaultCosTheta * this._defaultCosTheta);
			}

			// Token: 0x0600086B RID: 2155 RVA: 0x0004FDF0 File Offset: 0x0004DFF0
			private void _SyncDisplacement()
			{
				if (this._settings.syncDisplacement == FullBodyIK.SyncDisplacement.Everyframe || !this._isSyncDisplacementAtLeastOnce)
				{
					this._isSyncDisplacementAtLeastOnce = true;
					FullBodyIK.SAFBIKMatMult(out this._beginToBendingBoneBasis, ref this._beginBone._localAxisBasisInv, ref this._bendingBone._localAxisBasis);
					if (this._armRollBones != null && this._beginBone != null && this._bendingBone != null)
					{
						FullBodyIK.SAFBIKMatMult(out this._arm_bendingToBeginBoneBasis, ref this._bendingBone._boneToBaseBasis, ref this._beginBone._baseToBoneBasis);
						FullBodyIK.SAFBIKMatMultGetRot(out this._arm_bendingWorldToBeginBoneRotation, ref this._bendingBone._worldToBaseBasis, ref this._beginBone._baseToBoneBasis);
					}
					if (this._elbowRollBones != null && this._endBone != null && this._bendingBone != null)
					{
						FullBodyIK.SAFBIKMatMultGetRot(out this._arm_endWorldToBendingBoneRotation, ref this._endBone._worldToBaseBasis, ref this._bendingBone._baseToBoneBasis);
					}
					this._beginToBendingLength = this._bendingBone._defaultLocalLength.length;
					this._beginToBendingLengthSq = this._bendingBone._defaultLocalLength.lengthSq;
					this._bendingToEndLength = this._endBone._defaultLocalLength.length;
					this._bendingToEndLengthSq = this._endBone._defaultLocalLength.lengthSq;
					this._beginToEndMaxLength = this._beginToBendingLength + this._bendingToEndLength;
					Vector3 a = this._endBone._defaultPosition - this._beginBone._defaultPosition;
					if (FullBodyIK.SAFBIKVecNormalize(ref a))
					{
						if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
						{
							if (this._limbIKSide == FullBodyIK.Side.Left)
							{
								a = -a;
							}
							Vector3 column = this._internalValues.defaultRootBasis.column1;
							Vector3 column2 = this._internalValues.defaultRootBasis.column2;
							if (FullBodyIK.SAFBIKComputeBasisLockX(out this._effectorToBeginBoneBasis, ref a, ref column, ref column2))
							{
								this._effectorToBeginBoneBasis = this._effectorToBeginBoneBasis.transpose;
							}
						}
						else
						{
							a = -a;
							Vector3 column3 = this._internalValues.defaultRootBasis.column0;
							Vector3 column4 = this._internalValues.defaultRootBasis.column2;
							if (FullBodyIK.SAFBIKComputeBasisLockY(out this._effectorToBeginBoneBasis, ref column3, ref a, ref column4))
							{
								this._effectorToBeginBoneBasis = this._effectorToBeginBoneBasis.transpose;
							}
						}
						FullBodyIK.SAFBIKMatMultRet0(ref this._effectorToBeginBoneBasis, ref this._beginBone._localAxisBasis);
					}
					if (this._limbIKType == FullBodyIK.LimbIKType.Leg)
					{
						this._leg_upperLimitNearCircleZ = 0f;
						this._leg_upperLimitNearCircleY = this._beginToEndMaxLength;
					}
					this._SyncDisplacement_UpdateArgs();
				}
			}

			// Token: 0x0600086C RID: 2156 RVA: 0x00050074 File Offset: 0x0004E274
			private void _UpdateArgs()
			{
				if (this._limbIKType == FullBodyIK.LimbIKType.Leg)
				{
					float legEffectorMinLengthRate = this._settings.limbIK.legEffectorMinLengthRate;
					if (this._effectorMinLength._b != legEffectorMinLengthRate)
					{
						this._effectorMinLength._Reset(this._beginToEndMaxLength, legEffectorMinLengthRate);
					}
					if (this._cache_kneeUpperLimitAngle != this._settings.limbIK.prefixKneeUpperLimitAngle || this._cache_legUpperLimitAngle != this._settings.limbIK.prefixLegUpperLimitAngle)
					{
						this._cache_kneeUpperLimitAngle = this._settings.limbIK.prefixKneeUpperLimitAngle;
						this._cache_legUpperLimitAngle = this._settings.limbIK.prefixLegUpperLimitAngle;
						FullBodyIK.CachedDegreesToCosSin cachedDegreesToCosSin = new FullBodyIK.CachedDegreesToCosSin(this._settings.limbIK.prefixKneeUpperLimitAngle);
						FullBodyIK.CachedDegreesToCosSin cachedDegreesToCosSin2 = new FullBodyIK.CachedDegreesToCosSin(this._settings.limbIK.prefixLegUpperLimitAngle);
						this._leg_upperLimitNearCircleZ = this._beginToBendingLength * cachedDegreesToCosSin2.cos + this._bendingToEndLength * cachedDegreesToCosSin.cos;
						this._leg_upperLimitNearCircleY = this._beginToBendingLength * cachedDegreesToCosSin2.sin + this._bendingToEndLength * cachedDegreesToCosSin.sin;
					}
				}
				if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					float num = this._settings.limbIK.armBasisForcefixEffectorLengthRate - this._settings.limbIK.armBasisForcefixEffectorLengthLerpRate;
					float armBasisForcefixEffectorLengthRate = this._settings.limbIK.armBasisForcefixEffectorLengthRate;
					if (this._arm_elbowBasisForcefixEffectorLengthBegin._b != num)
					{
						this._arm_elbowBasisForcefixEffectorLengthBegin._Reset(this._beginToEndMaxLength, num);
					}
					if (this._arm_elbowBasisForcefixEffectorLengthEnd._b != armBasisForcefixEffectorLengthRate)
					{
						this._arm_elbowBasisForcefixEffectorLengthEnd._Reset(this._beginToEndMaxLength, armBasisForcefixEffectorLengthRate);
					}
				}
				float num2 = (this._limbIKType != FullBodyIK.LimbIKType.Leg) ? this._settings.limbIK.armEffectorMaxLengthRate : this._settings.limbIK.legEffectorMaxLengthRate;
				if (this._effectorMaxLength._b != num2)
				{
					this._effectorMaxLength._Reset(this._beginToEndMaxLength, num2);
				}
			}

			// Token: 0x0600086D RID: 2157 RVA: 0x00050278 File Offset: 0x0004E478
			private void _SyncDisplacement_UpdateArgs()
			{
				if (this._limbIKType == FullBodyIK.LimbIKType.Leg)
				{
					float legEffectorMinLengthRate = this._settings.limbIK.legEffectorMinLengthRate;
					this._effectorMinLength._Reset(this._beginToEndMaxLength, legEffectorMinLengthRate);
					FullBodyIK.CachedDegreesToCosSin cachedDegreesToCosSin = new FullBodyIK.CachedDegreesToCosSin(this._settings.limbIK.prefixKneeUpperLimitAngle);
					FullBodyIK.CachedDegreesToCosSin cachedDegreesToCosSin2 = new FullBodyIK.CachedDegreesToCosSin(this._settings.limbIK.prefixLegUpperLimitAngle);
					this._leg_upperLimitNearCircleZ = this._beginToBendingLength * cachedDegreesToCosSin2.cos + this._bendingToEndLength * cachedDegreesToCosSin.cos;
					this._leg_upperLimitNearCircleY = this._beginToBendingLength * cachedDegreesToCosSin2.sin + this._bendingToEndLength * cachedDegreesToCosSin.sin;
				}
				float b = (this._limbIKType != FullBodyIK.LimbIKType.Leg) ? this._settings.limbIK.armEffectorMaxLengthRate : this._settings.limbIK.legEffectorMaxLengthRate;
				this._effectorMaxLength._Reset(this._beginToEndMaxLength, b);
			}

			// Token: 0x0600086E RID: 2158 RVA: 0x0005036C File Offset: 0x0004E56C
			private void _SolveBaseBasis(out FullBodyIK.Matrix3x3 baseBasis, ref FullBodyIK.Matrix3x3 parentBaseBasis, ref Vector3 effectorDir)
			{
				if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					Vector3 vector = (this._limbIKSide != FullBodyIK.Side.Left) ? effectorDir : (-effectorDir);
					Vector3 column = parentBaseBasis.column1;
					Vector3 column2 = parentBaseBasis.column2;
					if (FullBodyIK.SAFBIKComputeBasisLockX(out baseBasis, ref vector, ref column, ref column2))
					{
						FullBodyIK.SAFBIKMatMultRet0(ref baseBasis, ref this._effectorToBeginBoneBasis);
					}
					else
					{
						FullBodyIK.SAFBIKMatMult(out baseBasis, ref parentBaseBasis, ref this._beginBone._localAxisBasis);
					}
				}
				else
				{
					Vector3 vector2 = -effectorDir;
					Vector3 column3 = parentBaseBasis.column0;
					Vector3 column4 = parentBaseBasis.column2;
					if (FullBodyIK.SAFBIKComputeBasisLockY(out baseBasis, ref column3, ref vector2, ref column4))
					{
						FullBodyIK.SAFBIKMatMultRet0(ref baseBasis, ref this._effectorToBeginBoneBasis);
					}
					else
					{
						FullBodyIK.SAFBIKMatMult(out baseBasis, ref parentBaseBasis, ref this._beginBone._localAxisBasis);
					}
				}
			}

			// Token: 0x0600086F RID: 2159 RVA: 0x00050440 File Offset: 0x0004E640
			private static void _PrepareRollBones(ref FullBodyIK.LimbIK.RollBone[] rollBones, FullBodyIK.Bone[] bones)
			{
				if (bones != null && bones.Length > 0)
				{
					int num = bones.Length;
					float num2 = 1f / (float)(num + 1);
					float num3 = num2;
					rollBones = new FullBodyIK.LimbIK.RollBone[num];
					int i = 0;
					while (i < num)
					{
						rollBones[i].bone = bones[i];
						rollBones[i].rate = num3;
						i++;
						num3 += num2;
					}
				}
				else
				{
					rollBones = null;
				}
			}

			// Token: 0x06000870 RID: 2160 RVA: 0x000504B4 File Offset: 0x0004E6B4
			public void PresolveBeinding()
			{
				this._SyncDisplacement();
				if (!((this._limbIKType != FullBodyIK.LimbIKType.Leg) ? this._settings.limbIK.presolveElbowEnabled : this._settings.limbIK.presolveKneeEnabled))
				{
					return;
				}
				this._isPresolvedBending = false;
				if (this._beginBone == null || !this._beginBone.transformIsAlive || this._beginBone.parentBone == null || !this._beginBone.parentBone.transformIsAlive || this._bendingEffector == null || this._bendingEffector.bone == null || !this._bendingEffector.bone.transformIsAlive || this._endEffector == null || this._endEffector.bone == null || !this._endEffector.bone.transformIsAlive)
				{
					return;
				}
				if (!this._internalValues.animatorEnabled)
				{
					return;
				}
				if (this._bendingEffector.positionEnabled)
				{
					return;
				}
				if (this._limbIKType == FullBodyIK.LimbIKType.Leg)
				{
					if (this._settings.limbIK.presolveKneeRate < 1E-07f)
					{
						return;
					}
				}
				else if (this._settings.limbIK.presolveElbowRate < 1E-07f)
				{
					return;
				}
				Vector3 worldPosition = this._beginBone.worldPosition;
				Vector3 worldPosition2 = this._bendingEffector.bone.worldPosition;
				Vector3 worldPosition3 = this._endEffector.bone.worldPosition;
				Vector3 a = worldPosition3 - worldPosition;
				Vector3 a2 = worldPosition2 - worldPosition;
				float magnitude = a.magnitude;
				float magnitude2 = a2.magnitude;
				if (magnitude <= 1E-07f || magnitude2 <= 1E-07f)
				{
					return;
				}
				Vector3 presolvedEffectorDir = a * (1f / magnitude);
				Vector3 vector = a2 * (1f / magnitude2);
				Quaternion worldRotation = this._beginBone.parentBone.worldRotation;
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK.SAFBIKMatSetRotMult(out matrix3x, ref worldRotation, ref this._beginBone.parentBone._worldToBaseRotation);
				FullBodyIK.Matrix3x3 matrix3x2;
				this._SolveBaseBasis(out matrix3x2, ref matrix3x, ref presolvedEffectorDir);
				this._presolvedEffectorDir = presolvedEffectorDir;
				this._presolvedEffectorLength = magnitude;
				if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					Vector3 vector2 = (this._limbIKSide != FullBodyIK.Side.Left) ? vector : (-vector);
					Vector3 column = matrix3x.column1;
					Vector3 column2 = matrix3x.column2;
					FullBodyIK.Matrix3x3 matrix3x3;
					if (FullBodyIK.SAFBIKComputeBasisLockX(out matrix3x3, ref vector2, ref column, ref column2))
					{
						FullBodyIK.SAFBIKMatMultInv1(out this._presolvedBendingBasis, ref matrix3x3, ref matrix3x2);
						this._isPresolvedBending = true;
					}
				}
				else
				{
					Vector3 vector3 = -vector;
					Vector3 column3 = matrix3x.column0;
					Vector3 column4 = matrix3x.column2;
					FullBodyIK.Matrix3x3 matrix3x3;
					if (FullBodyIK.SAFBIKComputeBasisLockY(out matrix3x3, ref column3, ref vector3, ref column4))
					{
						FullBodyIK.SAFBIKMatMultInv1(out this._presolvedBendingBasis, ref matrix3x3, ref matrix3x2);
						this._isPresolvedBending = true;
					}
				}
			}

			// Token: 0x06000871 RID: 2161 RVA: 0x0005078C File Offset: 0x0004E98C
			private bool _PrefixLegEffectorPos_UpperNear(ref Vector3 localEffectorTrans)
			{
				float num = localEffectorTrans.y - this._leg_upperLimitNearCircleY;
				float num2 = localEffectorTrans.z;
				float leg_upperLimitNearCircleZ = this._leg_upperLimitNearCircleZ;
				float num3 = this._leg_upperLimitNearCircleY + this._effectorMinLength.value;
				if (leg_upperLimitNearCircleZ > 1E-07f && num3 > 1E-07f)
				{
					bool flag = false;
					num2 /= leg_upperLimitNearCircleZ;
					if (num > this._leg_upperLimitNearCircleY)
					{
						flag = true;
					}
					else
					{
						num /= num3;
						float num4 = FullBodyIK.SAFBIKSqrt(num * num + num2 * num2);
						if (num4 < 1f)
						{
							flag = true;
						}
					}
					if (flag)
					{
						float num5 = FullBodyIK.SAFBIKSqrt(1f - num2 * num2);
						if (num5 > 1E-07f)
						{
							localEffectorTrans.y = -num5 * num3 + this._leg_upperLimitNearCircleY;
						}
						else
						{
							localEffectorTrans.z = 0f;
							localEffectorTrans.y = -this._effectorMinLength.value;
						}
						return true;
					}
				}
				return false;
			}

			// Token: 0x06000872 RID: 2162 RVA: 0x00050874 File Offset: 0x0004EA74
			private static bool _PrefixLegEffectorPos_Circular_Far(ref Vector3 localEffectorTrans, float effectorLength)
			{
				return FullBodyIK.LimbIK._PrefixLegEffectorPos_Circular(ref localEffectorTrans, effectorLength, true);
			}

			// Token: 0x06000873 RID: 2163 RVA: 0x00050880 File Offset: 0x0004EA80
			private static bool _PrefixLegEffectorPos_Circular(ref Vector3 localEffectorTrans, float effectorLength, bool isFar)
			{
				float y = localEffectorTrans.y;
				float z = localEffectorTrans.z;
				float num = FullBodyIK.SAFBIKSqrt(y * y + z * z);
				if ((isFar && num > effectorLength) || (!isFar && num < effectorLength))
				{
					float num2 = FullBodyIK.SAFBIKSqrt(effectorLength * effectorLength - localEffectorTrans.z * localEffectorTrans.z);
					if (num2 > 1E-07f)
					{
						localEffectorTrans.y = -num2;
					}
					else
					{
						localEffectorTrans.z = 0f;
						localEffectorTrans.y = -effectorLength;
					}
					return true;
				}
				return false;
			}

			// Token: 0x06000874 RID: 2164 RVA: 0x00050908 File Offset: 0x0004EB08
			private static bool _PrefixLegEffectorPos_Upper_Circular_Far(ref Vector3 localEffectorTrans, float centerPositionZ, float effectorLengthZ, float effectorLengthY)
			{
				if (effectorLengthY > 1E-07f && effectorLengthZ > 1E-07f)
				{
					float num = localEffectorTrans.y;
					float num2 = localEffectorTrans.z - centerPositionZ;
					num /= effectorLengthY;
					num2 /= effectorLengthZ;
					float num3 = FullBodyIK.SAFBIKSqrt(num * num + num2 * num2);
					if (num3 > 1f)
					{
						float num4 = FullBodyIK.SAFBIKSqrt(1f - num2 * num2);
						if (num4 > 1E-07f)
						{
							localEffectorTrans.y = num4 * effectorLengthY;
						}
						else
						{
							localEffectorTrans.z = centerPositionZ;
							localEffectorTrans.y = effectorLengthY;
						}
						return true;
					}
				}
				return false;
			}

			// Token: 0x06000875 RID: 2165 RVA: 0x00050994 File Offset: 0x0004EB94
			private static void _ComputeLocalDirXZ(ref Vector3 localDir, out Vector3 localDirXZ)
			{
				if (localDir.y >= 0.9899999f)
				{
					localDirXZ = new Vector3(1f, 0f, 0f);
				}
				else if (localDir.y > 0.9799999f)
				{
					float num = (localDir.y - 0.98f) * 100f;
					localDirXZ = new Vector3(localDir.x + (1f - localDir.x) * num, 0f, localDir.z - localDir.z * num);
					if (!FullBodyIK.SAFBIKVecNormalizeXZ(ref localDirXZ))
					{
						localDirXZ = new Vector3(1f, 0f, 0f);
					}
				}
				else if (localDir.y <= -0.9899999f)
				{
					localDirXZ = new Vector3(-1f, 0f, 0f);
				}
				else if (localDir.y < -0.9799999f)
				{
					float num2 = (-0.98f - localDir.y) * 100f;
					localDirXZ = new Vector3(localDir.x + (-1f - localDir.x) * num2, 0f, localDir.z - localDir.z * num2);
					if (!FullBodyIK.SAFBIKVecNormalizeXZ(ref localDirXZ))
					{
						localDirXZ = new Vector3(-1f, 0f, 0f);
					}
				}
				else
				{
					localDirXZ = new Vector3(localDir.x, 0f, localDir.z);
					if (!FullBodyIK.SAFBIKVecNormalizeXZ(ref localDirXZ))
					{
						localDirXZ = new Vector3(1f, 0f, 0f);
					}
				}
			}

			// Token: 0x06000876 RID: 2166 RVA: 0x00050B1C File Offset: 0x0004ED1C
			private static void _ComputeLocalDirYZ(ref Vector3 localDir, out Vector3 localDirYZ)
			{
				if (localDir.x >= 0.9899999f)
				{
					localDirYZ = new Vector3(0f, 0f, -1f);
				}
				else if (localDir.x > 0.9799999f)
				{
					float num = (localDir.x - 0.98f) * 100f;
					localDirYZ = new Vector3(0f, localDir.y - localDir.y * num, localDir.z + (-1f - localDir.z) * num);
					if (!FullBodyIK.SAFBIKVecNormalizeYZ(ref localDirYZ))
					{
						localDirYZ = new Vector3(0f, 0f, -1f);
					}
				}
				else if (localDir.x <= -0.9899999f)
				{
					localDirYZ = new Vector3(0f, 0f, 1f);
				}
				else if (localDir.x < -0.9799999f)
				{
					float num2 = (-0.98f - localDir.x) * 100f;
					localDirYZ = new Vector3(0f, localDir.y - localDir.y * num2, localDir.z + (1f - localDir.z) * num2);
					if (!FullBodyIK.SAFBIKVecNormalizeYZ(ref localDirYZ))
					{
						localDirYZ = new Vector3(0f, 0f, 1f);
					}
				}
				else
				{
					localDirYZ = new Vector3(0f, localDir.y, localDir.z);
					if (!FullBodyIK.SAFBIKVecNormalizeYZ(ref localDirYZ))
					{
						localDirYZ = new Vector3(0f, 0f, (localDir.x < 0f) ? 1f : -1f);
					}
				}
			}

			// Token: 0x06000877 RID: 2167 RVA: 0x00050CBC File Offset: 0x0004EEBC
			public bool IsSolverEnabled()
			{
				if (!this._endEffector.positionEnabled && (!this._bendingEffector.positionEnabled || this._bendingEffector.pull <= 1E-07f))
				{
					if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
					{
						if (!this._settings.limbIK.armAlwaysSolveEnabled)
						{
							return false;
						}
					}
					else if (this._limbIKType == FullBodyIK.LimbIKType.Leg && !this._settings.limbIK.legAlwaysSolveEnabled)
					{
						return false;
					}
				}
				return true;
			}

			// Token: 0x06000878 RID: 2168 RVA: 0x00050D4C File Offset: 0x0004EF4C
			public bool Presolve(ref FullBodyIK.Matrix3x3 parentBaseBasis, ref Vector3 beginPos, out Vector3 solvedBeginToBendingDir, out Vector3 solvedBendingToEndDir)
			{
				float num;
				FullBodyIK.Matrix3x3 matrix3x;
				return this.PresolveInternal(ref parentBaseBasis, ref beginPos, out num, out matrix3x, out solvedBeginToBendingDir, out solvedBendingToEndDir);
			}

			// Token: 0x06000879 RID: 2169 RVA: 0x00050D68 File Offset: 0x0004EF68
			public bool PresolveInternal(ref FullBodyIK.Matrix3x3 parentBaseBasis, ref Vector3 beginPos, out float effectorLen, out FullBodyIK.Matrix3x3 baseBasis, out Vector3 solvedBeginToBendingDir, out Vector3 solvedBendingToEndDir)
			{
				solvedBeginToBendingDir = Vector3.zero;
				solvedBendingToEndDir = Vector3.zero;
				Vector3 vector = this._bendingEffector._hidden_worldPosition;
				Vector3 a = this._endEffector._hidden_worldPosition;
				if (this._bendingEffector.positionEnabled && this._bendingEffector.pull > 1E-07f)
				{
					Vector3 a2 = vector - beginPos;
					float sqrMagnitude = a2.sqrMagnitude;
					if (sqrMagnitude > this._bendingBone._defaultLocalLength.length)
					{
						float num = FullBodyIK.SAFBIKSqrt(sqrMagnitude);
						float num2 = num - this._bendingBone._defaultLocalLength.length;
						if (num2 < -1E-07f && num > 1E-07f)
						{
							vector += a2 * (num2 / num);
						}
					}
				}
				if (this._bendingEffector.positionEnabled && this._bendingEffector.pull > 1E-07f)
				{
					Vector3 a3 = a - vector;
					float magnitude = a3.magnitude;
					if (magnitude > 1E-07f)
					{
						float num3 = this._endBone._defaultLocalLength.length - magnitude;
						if (num3 > 1E-07f || num3 < -1E-07f)
						{
							float num4;
							if (this._endEffector.positionEnabled && this._endEffector.pull > 1E-07f)
							{
								num4 = this._bendingEffector.pull / (this._bendingEffector.pull + this._endEffector.pull);
							}
							else
							{
								num4 = this._bendingEffector.pull;
							}
							a += a3 * (num3 * num4 / magnitude);
						}
					}
				}
				FullBodyIK.Matrix3x3 transpose = parentBaseBasis.transpose;
				Vector3 vector2 = a - beginPos;
				effectorLen = vector2.magnitude;
				if (effectorLen <= 1E-07f)
				{
					baseBasis = FullBodyIK.Matrix3x3.identity;
					return false;
				}
				if (this._effectorMaxLength.value <= 1E-07f)
				{
					baseBasis = FullBodyIK.Matrix3x3.identity;
					return false;
				}
				Vector3 vector3 = vector2 * (1f / effectorLen);
				if (effectorLen > this._effectorMaxLength.value)
				{
					vector2 = vector3 * this._effectorMaxLength.value;
					a = beginPos + vector2;
					effectorLen = this._effectorMaxLength.value;
				}
				Vector3 vector4 = new Vector3(0f, 0f, 1f);
				if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					FullBodyIK.SAFBIKMatMultVec(out vector4, ref transpose, ref vector3);
				}
				if (this._limbIKType == FullBodyIK.LimbIKType.Leg && this._settings.limbIK.prefixLegEffectorEnabled)
				{
					Vector3 vector5;
					FullBodyIK.SAFBIKMatMultVec(out vector5, ref transpose, ref vector2);
					bool flag = false;
					bool flag2 = false;
					if (vector5.z >= 0f)
					{
						if (vector5.z >= this._beginToBendingLength + this._bendingToEndLength)
						{
							flag = true;
							vector5.z = this._beginToBendingLength + this._bendingToEndLength;
							vector5.y = 0f;
						}
						if (!flag && vector5.y >= -this._effectorMinLength.value && vector5.z <= this._leg_upperLimitNearCircleZ)
						{
							flag = true;
							flag2 = this._PrefixLegEffectorPos_UpperNear(ref vector5);
						}
						if (!flag && vector5.y >= 0f && vector5.z > this._leg_upperLimitNearCircleZ)
						{
							flag = true;
							FullBodyIK.LimbIK._PrefixLegEffectorPos_Upper_Circular_Far(ref vector5, this._leg_upperLimitNearCircleZ, this._beginToBendingLength + this._bendingToEndLength - this._leg_upperLimitNearCircleZ, this._leg_upperLimitNearCircleY);
						}
						if (!flag)
						{
							flag2 = FullBodyIK.LimbIK._PrefixLegEffectorPos_Circular_Far(ref vector5, this._beginToBendingLength + this._bendingToEndLength);
						}
					}
					else if (vector5.y >= -this._effectorMinLength.value)
					{
						flag2 = true;
						vector5.y = -this._effectorMinLength.value;
					}
					else
					{
						flag2 = FullBodyIK.LimbIK._PrefixLegEffectorPos_Circular_Far(ref vector5, this._beginToBendingLength + this._bendingToEndLength);
					}
					if (flag2)
					{
						FullBodyIK.SAFBIKMatMultVec(out vector2, ref parentBaseBasis, ref vector5);
						effectorLen = vector2.magnitude;
						a = beginPos + vector2;
						if (effectorLen > 1E-07f)
						{
							vector3 = vector2 * (1f / effectorLen);
						}
					}
				}
				this._SolveBaseBasis(out baseBasis, ref parentBaseBasis, ref vector3);
				if (!this._bendingEffector.positionEnabled)
				{
					bool flag3 = (this._limbIKType != FullBodyIK.LimbIKType.Leg) ? this._settings.limbIK.presolveElbowEnabled : this._settings.limbIK.presolveKneeEnabled;
					float num5 = (this._limbIKType != FullBodyIK.LimbIKType.Leg) ? this._settings.limbIK.presolveElbowRate : this._settings.limbIK.presolveKneeRate;
					float num6 = (this._limbIKType != FullBodyIK.LimbIKType.Leg) ? this._settings.limbIK.presolveElbowLerpAngle : this._settings.limbIK.presolveKneeLerpAngle;
					float num7 = (this._limbIKType != FullBodyIK.LimbIKType.Leg) ? this._settings.limbIK.presolveElbowLerpLengthRate : this._settings.limbIK.presolveKneeLerpLengthRate;
					Vector3 vector6 = Vector3.zero;
					if (flag3 && this._isPresolvedBending)
					{
						if (this._presolvedEffectorLength > 1E-07f)
						{
							float num8 = this._presolvedEffectorLength * num7;
							if (num8 > 1E-07f)
							{
								float num9 = Mathf.Abs(this._presolvedEffectorLength - effectorLen);
								if (num9 < num8)
								{
									num5 *= 1f - num9 / num8;
								}
								else
								{
									num5 = 0f;
								}
							}
							else
							{
								num5 = 0f;
							}
						}
						else
						{
							num5 = 0f;
						}
						if (num5 > 1E-07f)
						{
							if (this._presolvedLerpTheta._degrees != num6)
							{
								this._presolvedLerpTheta._Reset(num6);
							}
							if (this._presolvedLerpTheta.cos < 0.9999999f)
							{
								float num10 = Vector3.Dot(vector3, this._presolvedEffectorDir);
								if (num10 > this._presolvedLerpTheta.cos + 1E-07f)
								{
									float num11 = (num10 - this._presolvedLerpTheta.cos) / (1f - this._presolvedLerpTheta.cos);
									num5 *= num11;
								}
								else
								{
									num5 = 0f;
								}
							}
							else
							{
								num5 = 0f;
							}
						}
						if (num5 > 1E-07f)
						{
							FullBodyIK.Matrix3x3 matrix3x;
							FullBodyIK.SAFBIKMatMult(out matrix3x, ref baseBasis, ref this._presolvedBendingBasis);
							Vector3 a4;
							if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
							{
								a4 = ((this._limbIKSide != FullBodyIK.Side.Left) ? matrix3x.column0 : (-matrix3x.column0));
							}
							else
							{
								a4 = -matrix3x.column1;
							}
							vector6 = beginPos + a4 * this._beginToBendingLength;
							vector = vector6;
						}
					}
					else
					{
						num5 = 0f;
					}
					if (num5 < 0.9999999f)
					{
						float num12 = FullBodyIK.ComputeCosTheta(this._bendingToEndLengthSq, effectorLen * effectorLen, this._beginToBendingLengthSq, effectorLen, this._beginToBendingLength);
						float num13 = FullBodyIK.SAFBIKSqrtClamp01(1f - num12 * num12);
						float d = this._beginToBendingLength * (1f - Mathf.Max(this._defaultCosTheta - num12, 0f));
						float d2 = this._beginToBendingLength * Mathf.Max(num13 - this._defaultSinTheta, 0f);
						if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
						{
							Vector3 a5 = (this._limbIKSide != FullBodyIK.Side.Left) ? baseBasis.column0 : (-baseBasis.column0);
							float automaticElbowBaseAngle = this._settings.limbIK.automaticElbowBaseAngle;
							float automaticElbowLowerAngle = this._settings.limbIK.automaticElbowLowerAngle;
							float automaticElbowUpperAngle = this._settings.limbIK.automaticElbowUpperAngle;
							float num14 = automaticElbowBaseAngle;
							Vector3 vector7 = (this._limbIKSide != FullBodyIK.Side.Left) ? new Vector3(-vector4.x, vector4.y, vector4.z) : vector4;
							if (vector7.y < 0f)
							{
								num14 = Mathf.Lerp(num14, automaticElbowLowerAngle, -vector7.y);
							}
							else
							{
								num14 = Mathf.Lerp(num14, automaticElbowUpperAngle, vector7.y);
							}
							if (this._settings.limbIK.armEffectorBackfixEnabled)
							{
								float automaticElbowBackUpperAngle = this._settings.limbIK.automaticElbowBackUpperAngle;
								float automaticElbowBackLowerAngle = this._settings.limbIK.automaticElbowBackLowerAngle;
								float sin = this._internalValues.limbIK.armEffectorBackBeginTheta.sin;
								float sin2 = this._internalValues.limbIK.armEffectorBackCoreBeginTheta.sin;
								float cos = this._internalValues.limbIK.armEffectorBackCoreEndTheta.cos;
								float cos2 = this._internalValues.limbIK.armEffectorBackEndTheta.cos;
								float sin3 = this._internalValues.limbIK.armEffectorBackCoreUpperTheta.sin;
								float sin4 = this._internalValues.limbIK.armEffectorBackCoreLowerTheta.sin;
								Vector3 vector8;
								FullBodyIK.LimbIK._ComputeLocalDirXZ(ref vector7, out vector8);
								Vector3 vector9;
								FullBodyIK.LimbIK._ComputeLocalDirYZ(ref vector7, out vector9);
								if (vector8.z < sin && vector8.x > cos2)
								{
									float num15;
									if (vector9.y >= sin3)
									{
										num15 = automaticElbowBackUpperAngle;
									}
									else if (vector9.y <= sin4)
									{
										num15 = automaticElbowBackLowerAngle;
									}
									else
									{
										float num16 = sin3 - sin4;
										if (num16 > 1E-07f)
										{
											float t = (vector9.y - sin4) / num16;
											num15 = Mathf.Lerp(automaticElbowBackLowerAngle, automaticElbowBackUpperAngle, t);
										}
										else
										{
											num15 = automaticElbowBackLowerAngle;
										}
									}
									if (vector8.x < cos)
									{
										float num17 = cos - cos2;
										if (num17 > 1E-07f)
										{
											float t2 = (vector8.x - cos2) / num17;
											if (vector9.y <= sin4)
											{
												num14 = Mathf.Lerp(num14, num15, t2);
											}
											else if (vector9.y >= sin3)
											{
												num14 = Mathf.Lerp(num14, num15 - 360f, t2);
											}
											else
											{
												float num18 = Mathf.Lerp(num14, num15, t2);
												float num19 = Mathf.Lerp(num14, num15 - 360f, t2);
												float num20 = sin3 - sin4;
												if (num20 > 1E-07f)
												{
													float t3 = (vector9.y - sin4) / num20;
													if (num18 - num19 > 180f)
													{
														num19 += 360f;
													}
													num14 = Mathf.Lerp(num18, num19, t3);
												}
												else
												{
													num14 = num18;
												}
											}
										}
									}
									else if (vector8.z > sin2)
									{
										float num21 = sin - sin2;
										if (num21 > 1E-07f)
										{
											float t4 = (sin - vector8.z) / num21;
											if (vector7.y >= 0f)
											{
												num14 = Mathf.Lerp(num14, num15, t4);
											}
											else
											{
												num14 = Mathf.Lerp(num14, num15 - 360f, t4);
											}
										}
										else
										{
											num14 = num15;
										}
									}
									else
									{
										num14 = num15;
									}
								}
							}
							Vector3 vector10 = parentBaseBasis.column1;
							Vector3 vector11 = Vector3.Cross(baseBasis.column0, vector10);
							vector10 = Vector3.Cross(vector11, baseBasis.column0);
							if (!FullBodyIK.SAFBIKVecNormalize2(ref vector10, ref vector11))
							{
								vector10 = parentBaseBasis.column1;
								vector11 = parentBaseBasis.column2;
							}
							if (this._automaticArmElbowTheta._degrees != num14)
							{
								this._automaticArmElbowTheta._Reset(num14);
							}
							vector = beginPos + a5 * d + -vector10 * d2 * this._automaticArmElbowTheta.cos + -vector11 * d2 * this._automaticArmElbowTheta.sin;
						}
						else
						{
							float automaticKneeBaseAngle = this._settings.limbIK.automaticKneeBaseAngle;
							if (automaticKneeBaseAngle >= -1E-07f && automaticKneeBaseAngle <= 1E-07f)
							{
								vector = beginPos + -baseBasis.column1 * d + baseBasis.column2 * d2;
							}
							else
							{
								if (this._automaticKneeBaseTheta._degrees != automaticKneeBaseAngle)
								{
									this._automaticKneeBaseTheta._Reset(automaticKneeBaseAngle);
								}
								float cos3 = this._automaticKneeBaseTheta.cos;
								float num22 = FullBodyIK.SAFBIKSqrt(1f - cos3 * cos3);
								if (this._limbIKSide == FullBodyIK.Side.Right)
								{
									if (automaticKneeBaseAngle >= 0f)
									{
										num22 = -num22;
									}
								}
								else if (automaticKneeBaseAngle < 0f)
								{
									num22 = -num22;
								}
								vector = beginPos + -baseBasis.column1 * d + baseBasis.column0 * d2 * num22 + baseBasis.column2 * d2 * cos3;
							}
						}
					}
					if (num5 > 1E-07f)
					{
						vector = Vector3.Lerp(vector, vector6, num5);
					}
				}
				bool flag4 = false;
				Vector3 vector12 = vector - beginPos;
				Vector3 a6 = vector12 - vector3 * Vector3.Dot(vector3, vector12);
				float magnitude2 = a6.magnitude;
				if (magnitude2 > 1E-07f)
				{
					Vector3 a7 = a6 * (1f / magnitude2);
					float num23 = 2f * this._beginToBendingLength * effectorLen;
					if (num23 > 1E-07f)
					{
						float num24 = (this._beginToBendingLengthSq + effectorLen * effectorLen - this._bendingToEndLengthSq) / num23;
						float d3 = FullBodyIK.SAFBIKSqrtClamp01(1f - num24 * num24);
						Vector3 vector13 = vector3 * num24 * this._beginToBendingLength + a7 * d3 * this._beginToBendingLength;
						Vector3 vector14 = a - (beginPos + vector13);
						if (FullBodyIK.SAFBIKVecNormalize2(ref vector13, ref vector14))
						{
							flag4 = true;
							solvedBeginToBendingDir = vector13;
							solvedBendingToEndDir = vector14;
						}
					}
				}
				if (flag4 && this._limbIKType == FullBodyIK.LimbIKType.Arm && this._settings.limbIK.armEffectorInnerfixEnabled)
				{
					float sin5 = this._internalValues.limbIK.elbowFrontInnerLimitTheta.sin;
					float sin6 = this._internalValues.limbIK.elbowBackInnerLimitTheta.sin;
					Vector3 vector15;
					FullBodyIK.SAFBIKMatMultVec(out vector15, ref transpose, ref solvedBeginToBendingDir);
					bool flag5 = vector15.z < 0f;
					float num25 = (!flag5) ? sin5 : sin6;
					float num26 = (this._limbIKSide != FullBodyIK.Side.Left) ? (-vector15.x) : vector15.x;
					if (num26 > num25)
					{
						vector15.x = ((this._limbIKSide != FullBodyIK.Side.Left) ? (-num25) : num25);
						vector15.z = FullBodyIK.SAFBIKSqrt(1f - (vector15.x * vector15.x + vector15.y * vector15.y));
						if (flag5)
						{
							vector15.z = -vector15.z;
						}
						Vector3 vector16;
						FullBodyIK.SAFBIKMatMultVec(out vector16, ref parentBaseBasis, ref vector15);
						Vector3 b = beginPos + vector16 * this._beginToBendingLength;
						Vector3 vector17 = a - b;
						if (FullBodyIK.SAFBIKVecNormalize(ref vector17))
						{
							solvedBeginToBendingDir = vector16;
							solvedBendingToEndDir = vector17;
							if (this._settings.limbIK.armBasisForcefixEnabled)
							{
								effectorLen = (a - beginPos).magnitude;
							}
						}
					}
				}
				if (!flag4)
				{
					Vector3 vector18 = vector - beginPos;
					if (FullBodyIK.SAFBIKVecNormalize(ref vector18))
					{
						Vector3 b2 = beginPos + vector18 * this._beginToBendingLength;
						Vector3 vector19 = a - b2;
						if (FullBodyIK.SAFBIKVecNormalize(ref vector19))
						{
							flag4 = true;
							solvedBeginToBendingDir = vector18;
							solvedBendingToEndDir = vector19;
						}
					}
				}
				return flag4;
			}

			// Token: 0x0600087A RID: 2170 RVA: 0x00051D60 File Offset: 0x0004FF60
			public bool Solve()
			{
				this._UpdateArgs();
				this._arm_isSolvedLimbIK = false;
				Quaternion quaternion = Quaternion.identity;
				Quaternion quaternion2 = Quaternion.identity;
				if (!this._internalValues.resetTransforms)
				{
					float num = (!this._endEffector.rotationEnabled) ? 0f : this._endEffector.rotationWeight;
					if (num > 1E-07f && num < 0.9999999f)
					{
						quaternion = this._bendingBone.worldRotation;
						quaternion2 = this._endBone.worldRotation;
					}
				}
				bool flag = this._SolveInternal();
				flag |= this._SolveEndRotation(flag, ref quaternion, ref quaternion2);
				return flag | this._RollInternal();
			}

			// Token: 0x0600087B RID: 2171 RVA: 0x00051E0C File Offset: 0x0005000C
			public bool _SolveInternal()
			{
				if (!this.IsSolverEnabled())
				{
					return false;
				}
				if (this._beginBone.parentBone == null || !this._beginBone.parentBone.transformIsAlive)
				{
					return false;
				}
				Quaternion worldRotation = this._beginBone.parentBone.worldRotation;
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK.SAFBIKMatSetRotMult(out matrix3x, ref worldRotation, ref this._beginBone.parentBone._worldToBaseRotation);
				Vector3 worldPosition = this._beginBone.worldPosition;
				float num;
				FullBodyIK.Matrix3x3 matrix3x2;
				Vector3 a;
				Vector3 vector;
				if (!this.PresolveInternal(ref matrix3x, ref worldPosition, out num, out matrix3x2, out a, out vector))
				{
					return false;
				}
				FullBodyIK.Matrix3x3 identity = FullBodyIK.Matrix3x3.identity;
				FullBodyIK.Matrix3x3 identity2 = FullBodyIK.Matrix3x3.identity;
				if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					if (this._limbIKSide == FullBodyIK.Side.Left)
					{
						a = -a;
						vector = -vector;
					}
					Vector3 a2 = matrix3x.column1;
					Vector3 column = matrix3x.column2;
					if (!FullBodyIK.SAFBIKComputeBasisLockX(out identity, ref a, ref a2, ref column))
					{
						return false;
					}
					bool armBasisForcefixEnabled = this._settings.limbIK.armBasisForcefixEnabled;
					if (armBasisForcefixEnabled && num > this._arm_elbowBasisForcefixEffectorLengthEnd.value)
					{
						FullBodyIK.SAFBIKMatMultCol1(out a2, ref identity, ref this._beginToBendingBoneBasis);
					}
					else
					{
						a2 = Vector3.Cross(-a, vector);
						if (this._limbIKSide == FullBodyIK.Side.Left)
						{
							a2 = -a2;
						}
						if (armBasisForcefixEnabled && num > this._arm_elbowBasisForcefixEffectorLengthBegin.value)
						{
							float num2 = this._arm_elbowBasisForcefixEffectorLengthEnd.value - this._arm_elbowBasisForcefixEffectorLengthBegin.value;
							if (num2 > 1E-07f)
							{
								float t = (num - this._arm_elbowBasisForcefixEffectorLengthBegin.value) / num2;
								Vector3 b;
								FullBodyIK.SAFBIKMatMultCol1(out b, ref identity, ref this._beginToBendingBoneBasis);
								a2 = Vector3.Lerp(a2, b, t);
							}
						}
					}
					if (!FullBodyIK.SAFBIKComputeBasisFromXYLockX(out identity2, ref vector, ref a2))
					{
						return false;
					}
				}
				else
				{
					a = -a;
					vector = -vector;
					Vector3 column2 = matrix3x2.column0;
					Vector3 column3 = matrix3x2.column2;
					if (!FullBodyIK.SAFBIKComputeBasisLockY(out identity, ref column2, ref a, ref column3))
					{
						return false;
					}
					FullBodyIK.SAFBIKMatMultCol0(out column2, ref identity, ref this._beginToBendingBoneBasis);
					if (!FullBodyIK.SAFBIKComputeBasisFromXYLockY(out identity2, ref column2, ref vector))
					{
						return false;
					}
				}
				if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					this._arm_isSolvedLimbIK = true;
					this._arm_solvedBeginBoneBasis = identity;
					this._arm_solvedBendingBoneBasis = identity2;
				}
				Quaternion worldRotation2;
				FullBodyIK.SAFBIKMatMultGetRot(out worldRotation2, ref identity, ref this._beginBone._boneToWorldBasis);
				this._beginBone.worldRotation = worldRotation2;
				FullBodyIK.SAFBIKMatMultGetRot(out worldRotation2, ref identity2, ref this._bendingBone._boneToWorldBasis);
				this._bendingBone.worldRotation = worldRotation2;
				return true;
			}

			// Token: 0x0600087C RID: 2172 RVA: 0x0005209C File Offset: 0x0005029C
			private bool _SolveEndRotation(bool isSolved, ref Quaternion bendingBonePrevRotation, ref Quaternion endBonePrevRotation)
			{
				float num = (!this._endEffector.rotationEnabled) ? 0f : this._endEffector.rotationWeight;
				if (num > 1E-07f)
				{
					Quaternion worldRotation = this._endEffector.worldRotation;
					Quaternion quaternion;
					FullBodyIK.SAFBIKQuatMult(out quaternion, ref worldRotation, ref this._endEffectorToWorldRotation);
					if (num < 0.9999999f)
					{
						Quaternion a;
						if (this._internalValues.resetTransforms)
						{
							Quaternion worldRotation2 = this._bendingBone.worldRotation;
							FullBodyIK.SAFBIKQuatMult3(out a, ref worldRotation2, ref this._bendingBone._worldToBaseRotation, ref this._endBone._baseToWorldRotation);
						}
						else if (isSolved)
						{
							Quaternion worldRotation3 = this._bendingBone.worldRotation;
							FullBodyIK.SAFBIKQuatMultNorm3Inv1(out a, ref worldRotation3, ref bendingBonePrevRotation, ref endBonePrevRotation);
						}
						else
						{
							a = endBonePrevRotation;
						}
						this._endBone.worldRotation = Quaternion.Lerp(a, quaternion, num);
					}
					else
					{
						this._endBone.worldRotation = quaternion;
					}
					this._EndRotationLimit();
					return true;
				}
				if (this._internalValues.resetTransforms)
				{
					Quaternion worldRotation4 = this._bendingBone.worldRotation;
					Quaternion worldRotation5;
					FullBodyIK.SAFBIKQuatMult3(out worldRotation5, ref worldRotation4, ref this._bendingBone._worldToBaseRotation, ref this._endBone._baseToWorldRotation);
					this._endBone.worldRotation = worldRotation5;
					return true;
				}
				return false;
			}

			// Token: 0x0600087D RID: 2173 RVA: 0x000521E4 File Offset: 0x000503E4
			private void _EndRotationLimit()
			{
				if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					if (!this._settings.limbIK.wristLimitEnabled)
					{
						return;
					}
				}
				else if (this._limbIKType == FullBodyIK.LimbIKType.Leg && !this._settings.limbIK.footLimitEnabled)
				{
					return;
				}
				Quaternion worldRotation = this._endBone.worldRotation;
				Quaternion worldRotation2;
				FullBodyIK.SAFBIKQuatMult(out worldRotation2, ref worldRotation, ref this._endBone._worldToBaseRotation);
				worldRotation = this._bendingBone.worldRotation;
				Quaternion quaternion;
				FullBodyIK.SAFBIKQuatMult(out quaternion, ref worldRotation, ref this._bendingBone._worldToBaseRotation);
				Quaternion quaternion2;
				FullBodyIK.SAFBIKQuatMultInv0(out quaternion2, ref quaternion, ref worldRotation2);
				if (this._limbIKType == FullBodyIK.LimbIKType.Arm)
				{
					bool flag = false;
					float wristLimitAngle = this._settings.limbIK.wristLimitAngle;
					float num;
					Vector3 axis;
					quaternion2.ToAngleAxis(out num, out axis);
					if (num < -wristLimitAngle)
					{
						num = -wristLimitAngle;
						flag = true;
					}
					else if (num > wristLimitAngle)
					{
						num = wristLimitAngle;
						flag = true;
					}
					if (flag)
					{
						quaternion2 = Quaternion.AngleAxis(num, axis);
						FullBodyIK.SAFBIKQuatMultNorm3(out worldRotation2, ref quaternion, ref quaternion2, ref this._endBone._baseToWorldRotation);
						this._endBone.worldRotation = worldRotation2;
					}
				}
				else if (this._limbIKType == FullBodyIK.LimbIKType.Leg)
				{
					FullBodyIK.Matrix3x3 matrix3x;
					FullBodyIK.SAFBIKMatSetRot(out matrix3x, ref quaternion2);
					Vector3 column = matrix3x.column1;
					Vector3 column2 = matrix3x.column2;
					bool flag2 = false;
					flag2 |= FullBodyIK._LimitXZ_Square(ref column, this._internalValues.limbIK.footLimitRollTheta.sin, this._internalValues.limbIK.footLimitRollTheta.sin, this._internalValues.limbIK.footLimitPitchUpTheta.sin, this._internalValues.limbIK.footLimitPitchDownTheta.sin);
					flag2 |= FullBodyIK._LimitXY_Square(ref column2, this._internalValues.limbIK.footLimitYawTheta.sin, this._internalValues.limbIK.footLimitYawTheta.sin, this._internalValues.limbIK.footLimitPitchDownTheta.sin, this._internalValues.limbIK.footLimitPitchUpTheta.sin);
					if (flag2 && FullBodyIK.SAFBIKComputeBasisFromYZLockZ(out matrix3x, ref column, ref column2))
					{
						FullBodyIK.SAFBIKMatGetRot(out quaternion2, ref matrix3x);
						FullBodyIK.SAFBIKQuatMultNorm3(out worldRotation2, ref quaternion, ref quaternion2, ref this._endBone._baseToWorldRotation);
						this._endBone.worldRotation = worldRotation2;
					}
				}
			}

			// Token: 0x0600087E RID: 2174 RVA: 0x0005243C File Offset: 0x0005063C
			private bool _RollInternal()
			{
				if (this._limbIKType != FullBodyIK.LimbIKType.Arm || !this._settings.rollBonesEnabled)
				{
					return false;
				}
				bool result = false;
				if (this._armRollBones != null && this._armRollBones.Length > 0)
				{
					int num = this._armRollBones.Length;
					FullBodyIK.Matrix3x3 arm_solvedBeginBoneBasis;
					FullBodyIK.Matrix3x3 matrix3x;
					if (this._arm_isSolvedLimbIK)
					{
						arm_solvedBeginBoneBasis = this._arm_solvedBeginBoneBasis;
						FullBodyIK.SAFBIKMatMult(out matrix3x, ref this._arm_solvedBendingBoneBasis, ref this._arm_bendingToBeginBoneBasis);
					}
					else
					{
						arm_solvedBeginBoneBasis = new FullBodyIK.Matrix3x3(this._beginBone.worldRotation * this._beginBone._worldToBoneRotation);
						matrix3x = new FullBodyIK.Matrix3x3(this._bendingBone.worldRotation * this._arm_bendingWorldToBeginBoneRotation);
					}
					Vector3 column = arm_solvedBeginBoneBasis.column0;
					Vector3 column2 = matrix3x.column1;
					Vector3 column3 = matrix3x.column2;
					FullBodyIK.Matrix3x3 matrix3x2;
					if (FullBodyIK.SAFBIKComputeBasisLockX(out matrix3x2, ref column, ref column2, ref column3))
					{
						FullBodyIK.Matrix3x3 matrix3x3;
						FullBodyIK.SAFBIKMatMult(out matrix3x3, ref arm_solvedBeginBoneBasis, ref this._beginBone._boneToBaseBasis);
						FullBodyIK.Matrix3x3 matrix3x4;
						FullBodyIK.SAFBIKMatMult(out matrix3x4, ref matrix3x2, ref this._beginBone._boneToBaseBasis);
						for (int i = 0; i < num; i++)
						{
							if (this._armRollBones[i].bone != null && this._armRollBones[i].bone.transformIsAlive)
							{
								float rate = this._armRollBones[i].rate;
								FullBodyIK.Matrix3x3 matrix3x5;
								FullBodyIK.SAFBIKMatFastLerp(out matrix3x5, ref matrix3x3, ref matrix3x4, rate);
								Quaternion worldRotation;
								FullBodyIK.SAFBIKMatMultGetRot(out worldRotation, ref matrix3x5, ref this._elbowRollBones[i].bone._baseToWorldBasis);
								this._armRollBones[i].bone.worldRotation = worldRotation;
								result = true;
							}
						}
					}
				}
				if (this._elbowRollBones != null && this._elbowRollBones.Length > 0)
				{
					int num2 = this._elbowRollBones.Length;
					FullBodyIK.Matrix3x3 arm_solvedBendingBoneBasis;
					if (this._arm_isSolvedLimbIK)
					{
						arm_solvedBendingBoneBasis = this._arm_solvedBendingBoneBasis;
					}
					else
					{
						arm_solvedBendingBoneBasis = new FullBodyIK.Matrix3x3(this._bendingBone.worldRotation * this._bendingBone._worldToBoneRotation);
					}
					FullBodyIK.Matrix3x3 matrix3x6 = new FullBodyIK.Matrix3x3(this._endBone.worldRotation * this._arm_endWorldToBendingBoneRotation);
					Vector3 lhs = matrix3x6.column2;
					Vector3 column4 = arm_solvedBendingBoneBasis.column0;
					Vector3 rhs = Vector3.Cross(lhs, column4);
					lhs = Vector3.Cross(column4, rhs);
					if (FullBodyIK.SAFBIKVecNormalize2(ref rhs, ref lhs))
					{
						FullBodyIK.Matrix3x3 matrix3x7 = FullBodyIK.Matrix3x3.FromColumn(ref column4, ref rhs, ref lhs);
						FullBodyIK.Matrix3x3 matrix3x8;
						FullBodyIK.SAFBIKMatMult(out matrix3x8, ref arm_solvedBendingBoneBasis, ref this._bendingBone._boneToBaseBasis);
						FullBodyIK.SAFBIKMatMultRet0(ref matrix3x7, ref this._bendingBone._boneToBaseBasis);
						for (int j = 0; j < num2; j++)
						{
							if (this._elbowRollBones[j].bone != null && this._elbowRollBones[j].bone.transformIsAlive)
							{
								float rate2 = this._elbowRollBones[j].rate;
								FullBodyIK.Matrix3x3 matrix3x9;
								FullBodyIK.SAFBIKMatFastLerp(out matrix3x9, ref matrix3x8, ref matrix3x7, rate2);
								Quaternion worldRotation2;
								FullBodyIK.SAFBIKMatMultGetRot(out worldRotation2, ref matrix3x9, ref this._elbowRollBones[j].bone._baseToWorldBasis);
								this._elbowRollBones[j].bone.worldRotation = worldRotation2;
								result = true;
							}
						}
					}
				}
				return result;
			}

			// Token: 0x04000D98 RID: 3480
			private FullBodyIK.Settings _settings;

			// Token: 0x04000D99 RID: 3481
			private FullBodyIK.InternalValues _internalValues;

			// Token: 0x04000D9A RID: 3482
			public FullBodyIK.LimbIKLocation _limbIKLocation;

			// Token: 0x04000D9B RID: 3483
			private FullBodyIK.LimbIKType _limbIKType;

			// Token: 0x04000D9C RID: 3484
			private FullBodyIK.Side _limbIKSide;

			// Token: 0x04000D9D RID: 3485
			private FullBodyIK.Bone _beginBone;

			// Token: 0x04000D9E RID: 3486
			private FullBodyIK.Bone _bendingBone;

			// Token: 0x04000D9F RID: 3487
			private FullBodyIK.Bone _endBone;

			// Token: 0x04000DA0 RID: 3488
			private FullBodyIK.Effector _bendingEffector;

			// Token: 0x04000DA1 RID: 3489
			private FullBodyIK.Effector _endEffector;

			// Token: 0x04000DA2 RID: 3490
			private FullBodyIK.LimbIK.RollBone[] _armRollBones;

			// Token: 0x04000DA3 RID: 3491
			private FullBodyIK.LimbIK.RollBone[] _elbowRollBones;

			// Token: 0x04000DA4 RID: 3492
			public float _beginToBendingLength;

			// Token: 0x04000DA5 RID: 3493
			public float _beginToBendingLengthSq;

			// Token: 0x04000DA6 RID: 3494
			public float _bendingToEndLength;

			// Token: 0x04000DA7 RID: 3495
			public float _bendingToEndLengthSq;

			// Token: 0x04000DA8 RID: 3496
			private FullBodyIK.Matrix3x3 _beginToBendingBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000DA9 RID: 3497
			private Quaternion _endEffectorToWorldRotation = Quaternion.identity;

			// Token: 0x04000DAA RID: 3498
			private FullBodyIK.Matrix3x3 _effectorToBeginBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000DAB RID: 3499
			private float _defaultSinTheta;

			// Token: 0x04000DAC RID: 3500
			private float _defaultCosTheta = 1f;

			// Token: 0x04000DAD RID: 3501
			private float _beginToEndMaxLength;

			// Token: 0x04000DAE RID: 3502
			private FullBodyIK.CachedScaledValue _effectorMaxLength = FullBodyIK.CachedScaledValue.zero;

			// Token: 0x04000DAF RID: 3503
			private FullBodyIK.CachedScaledValue _effectorMinLength = FullBodyIK.CachedScaledValue.zero;

			// Token: 0x04000DB0 RID: 3504
			private float _leg_upperLimitNearCircleZ;

			// Token: 0x04000DB1 RID: 3505
			private float _leg_upperLimitNearCircleY;

			// Token: 0x04000DB2 RID: 3506
			private FullBodyIK.CachedScaledValue _arm_elbowBasisForcefixEffectorLengthBegin = FullBodyIK.CachedScaledValue.zero;

			// Token: 0x04000DB3 RID: 3507
			private FullBodyIK.CachedScaledValue _arm_elbowBasisForcefixEffectorLengthEnd = FullBodyIK.CachedScaledValue.zero;

			// Token: 0x04000DB4 RID: 3508
			private FullBodyIK.Matrix3x3 _arm_bendingToBeginBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000DB5 RID: 3509
			private Quaternion _arm_bendingWorldToBeginBoneRotation = Quaternion.identity;

			// Token: 0x04000DB6 RID: 3510
			private Quaternion _arm_endWorldToBendingBoneRotation = Quaternion.identity;

			// Token: 0x04000DB7 RID: 3511
			private bool _arm_isSolvedLimbIK;

			// Token: 0x04000DB8 RID: 3512
			private FullBodyIK.Matrix3x3 _arm_solvedBeginBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000DB9 RID: 3513
			private FullBodyIK.Matrix3x3 _arm_solvedBendingBoneBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000DBA RID: 3514
			private bool _isSyncDisplacementAtLeastOnce;

			// Token: 0x04000DBB RID: 3515
			private float _cache_legUpperLimitAngle;

			// Token: 0x04000DBC RID: 3516
			private float _cache_kneeUpperLimitAngle;

			// Token: 0x04000DBD RID: 3517
			private bool _isPresolvedBending;

			// Token: 0x04000DBE RID: 3518
			private FullBodyIK.Matrix3x3 _presolvedBendingBasis = FullBodyIK.Matrix3x3.identity;

			// Token: 0x04000DBF RID: 3519
			private Vector3 _presolvedEffectorDir = Vector3.zero;

			// Token: 0x04000DC0 RID: 3520
			private float _presolvedEffectorLength;

			// Token: 0x04000DC1 RID: 3521
			private const float _LocalDirMaxTheta = 0.99f;

			// Token: 0x04000DC2 RID: 3522
			private const float _LocalDirLerpTheta = 0.01f;

			// Token: 0x04000DC3 RID: 3523
			private FullBodyIK.CachedDegreesToCos _presolvedLerpTheta = FullBodyIK.CachedDegreesToCos.zero;

			// Token: 0x04000DC4 RID: 3524
			private FullBodyIK.CachedDegreesToCos _automaticKneeBaseTheta = FullBodyIK.CachedDegreesToCos.zero;

			// Token: 0x04000DC5 RID: 3525
			private FullBodyIK.CachedDegreesToCosSin _automaticArmElbowTheta = FullBodyIK.CachedDegreesToCosSin.zero;

			// Token: 0x020001A1 RID: 417
			private struct RollBone
			{
				// Token: 0x04000DC6 RID: 3526
				public FullBodyIK.Bone bone;

				// Token: 0x04000DC7 RID: 3527
				public float rate;
			}
		}

		// Token: 0x020001A2 RID: 418
		[Serializable]
		[StructLayout(LayoutKind.Sequential, Pack = 4)]
		public struct Float2
		{
			// Token: 0x04000DC8 RID: 3528
			[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
			public float[] v;
		}

		// Token: 0x020001A3 RID: 419
		[Serializable]
		[StructLayout(LayoutKind.Sequential, Pack = 4)]
		public struct Matrix3x3
		{
			// Token: 0x0600087F RID: 2175 RVA: 0x00052778 File Offset: 0x00050978
			public Matrix3x3(float _11, float _12, float _13, float _21, float _22, float _23, float _31, float _32, float _33)
			{
				this.column0 = new Vector3(_11, _21, _31);
				this.column1 = new Vector3(_12, _22, _32);
				this.column2 = new Vector3(_13, _23, _33);
			}

			// Token: 0x06000880 RID: 2176 RVA: 0x000527AA File Offset: 0x000509AA
			public Matrix3x3(Vector3 axis, float cos)
			{
				FullBodyIK.SAFBIKMatSetAxisAngle(out this, ref axis, cos);
			}

			// Token: 0x06000881 RID: 2177 RVA: 0x000527B5 File Offset: 0x000509B5
			public Matrix3x3(ref Vector3 axis, float cos)
			{
				FullBodyIK.SAFBIKMatSetAxisAngle(out this, ref axis, cos);
			}

			// Token: 0x06000882 RID: 2178 RVA: 0x000527C0 File Offset: 0x000509C0
			public Matrix3x3(Matrix4x4 m)
			{
				this.column0 = new Vector3(m.m00, m.m10, m.m20);
				this.column1 = new Vector3(m.m01, m.m11, m.m21);
				this.column2 = new Vector3(m.m02, m.m12, m.m22);
			}

			// Token: 0x06000883 RID: 2179 RVA: 0x00052830 File Offset: 0x00050A30
			public Matrix3x3(ref Matrix4x4 m)
			{
				this.column0 = new Vector3(m.m00, m.m10, m.m20);
				this.column1 = new Vector3(m.m01, m.m11, m.m21);
				this.column2 = new Vector3(m.m02, m.m12, m.m22);
			}

			// Token: 0x06000884 RID: 2180 RVA: 0x00052894 File Offset: 0x00050A94
			public Matrix3x3(Quaternion q)
			{
				FullBodyIK.SAFBIKMatSetRot(out this, ref q);
			}

			// Token: 0x06000885 RID: 2181 RVA: 0x0005289E File Offset: 0x00050A9E
			public Matrix3x3(ref Quaternion q)
			{
				FullBodyIK.SAFBIKMatSetRot(out this, ref q);
			}

			// Token: 0x17000135 RID: 309
			// (get) Token: 0x06000886 RID: 2182 RVA: 0x000528A7 File Offset: 0x00050AA7
			public Vector3 row0
			{
				get
				{
					return new Vector3(this.column0.x, this.column1.x, this.column2.x);
				}
			}

			// Token: 0x17000136 RID: 310
			// (get) Token: 0x06000887 RID: 2183 RVA: 0x000528CF File Offset: 0x00050ACF
			public Vector3 row1
			{
				get
				{
					return new Vector3(this.column0.y, this.column1.y, this.column2.y);
				}
			}

			// Token: 0x17000137 RID: 311
			// (get) Token: 0x06000888 RID: 2184 RVA: 0x000528F7 File Offset: 0x00050AF7
			public Vector3 row2
			{
				get
				{
					return new Vector3(this.column0.z, this.column1.z, this.column2.z);
				}
			}

			// Token: 0x17000138 RID: 312
			// (get) Token: 0x06000889 RID: 2185 RVA: 0x00052920 File Offset: 0x00050B20
			public bool isFuzzyIdentity
			{
				get
				{
					return this.column0.x >= 0.9999999f && this.column1.x >= -1E-07f && this.column2.x >= -1E-07f && this.column0.y >= -1E-07f && this.column1.y >= 0.9999999f && this.column2.y >= -1E-07f && this.column0.z >= -1E-07f && this.column1.z >= -1E-07f && this.column2.z >= 0.9999999f && this.column0.x <= 1.0000001f && this.column1.x <= 1E-07f && this.column2.x <= 1E-07f && this.column0.y <= 1E-07f && this.column1.y <= 1.0000001f && this.column2.y <= 1E-07f && this.column0.z <= 1E-07f && this.column1.z <= 1E-07f && this.column2.z <= 1.0000001f;
				}
			}

			// Token: 0x17000139 RID: 313
			// (get) Token: 0x0600088A RID: 2186 RVA: 0x00052AAC File Offset: 0x00050CAC
			public FullBodyIK.Matrix3x3 transpose
			{
				get
				{
					return new FullBodyIK.Matrix3x3(this.column0.x, this.column0.y, this.column0.z, this.column1.x, this.column1.y, this.column1.z, this.column2.x, this.column2.y, this.column2.z);
				}
			}

			// Token: 0x0600088B RID: 2187 RVA: 0x00052B24 File Offset: 0x00050D24
			public static FullBodyIK.Matrix3x3 FromColumn(Vector3 column0, Vector3 column1, Vector3 column2)
			{
				FullBodyIK.Matrix3x3 result = default(FullBodyIK.Matrix3x3);
				result.SetColumn(ref column0, ref column1, ref column2);
				return result;
			}

			// Token: 0x0600088C RID: 2188 RVA: 0x00052B48 File Offset: 0x00050D48
			public static FullBodyIK.Matrix3x3 FromColumn(ref Vector3 column0, ref Vector3 column1, ref Vector3 column2)
			{
				FullBodyIK.Matrix3x3 result = default(FullBodyIK.Matrix3x3);
				result.SetColumn(ref column0, ref column1, ref column2);
				return result;
			}

			// Token: 0x0600088D RID: 2189 RVA: 0x00052B68 File Offset: 0x00050D68
			public void SetValue(float _11, float _12, float _13, float _21, float _22, float _23, float _31, float _32, float _33)
			{
				this.column0.x = _11;
				this.column1.x = _12;
				this.column2.x = _13;
				this.column0.y = _21;
				this.column1.y = _22;
				this.column2.y = _23;
				this.column0.z = _31;
				this.column1.z = _32;
				this.column2.z = _33;
			}

			// Token: 0x0600088E RID: 2190 RVA: 0x00052BE8 File Offset: 0x00050DE8
			public void SetValue(Matrix4x4 m)
			{
				this.column0.x = m.m00;
				this.column1.x = m.m01;
				this.column2.x = m.m02;
				this.column0.y = m.m10;
				this.column1.y = m.m11;
				this.column2.y = m.m12;
				this.column0.z = m.m20;
				this.column1.z = m.m21;
				this.column2.z = m.m22;
			}

			// Token: 0x0600088F RID: 2191 RVA: 0x00052C98 File Offset: 0x00050E98
			public void SetValue(ref Matrix4x4 m)
			{
				this.column0.x = m.m00;
				this.column1.x = m.m01;
				this.column2.x = m.m02;
				this.column0.y = m.m10;
				this.column1.y = m.m11;
				this.column2.y = m.m12;
				this.column0.z = m.m20;
				this.column1.z = m.m21;
				this.column2.z = m.m22;
			}

			// Token: 0x06000890 RID: 2192 RVA: 0x00052D3E File Offset: 0x00050F3E
			public void SetColumn(Vector3 c0, Vector3 c1, Vector3 c2)
			{
				this.column0 = c0;
				this.column1 = c1;
				this.column2 = c2;
			}

			// Token: 0x06000891 RID: 2193 RVA: 0x00052D55 File Offset: 0x00050F55
			public void SetColumn(ref Vector3 c0, ref Vector3 c1, ref Vector3 c2)
			{
				this.column0 = c0;
				this.column1 = c1;
				this.column2 = c2;
			}

			// Token: 0x06000892 RID: 2194 RVA: 0x00052D7C File Offset: 0x00050F7C
			public static implicit operator Matrix4x4(FullBodyIK.Matrix3x3 m)
			{
				Matrix4x4 result = Matrix4x4.identity;
				result.m00 = m.column0.x;
				result.m01 = m.column1.x;
				result.m02 = m.column2.x;
				result.m10 = m.column0.y;
				result.m11 = m.column1.y;
				result.m12 = m.column2.y;
				result.m20 = m.column0.z;
				result.m21 = m.column1.z;
				result.m22 = m.column2.z;
				return result;
			}

			// Token: 0x06000893 RID: 2195 RVA: 0x00052E3B File Offset: 0x0005103B
			public static implicit operator FullBodyIK.Matrix3x3(Matrix4x4 m)
			{
				return new FullBodyIK.Matrix3x3(ref m);
			}

			// Token: 0x06000894 RID: 2196 RVA: 0x00052E44 File Offset: 0x00051044
			public override string ToString()
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(this.row0.ToString());
				stringBuilder.Append(" : ");
				stringBuilder.Append(this.row1.ToString());
				stringBuilder.Append(" : ");
				stringBuilder.Append(this.row2.ToString());
				return stringBuilder.ToString();
			}

			// Token: 0x06000895 RID: 2197 RVA: 0x00052EC8 File Offset: 0x000510C8
			public string ToString(string format)
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(this.row0.ToString(format));
				stringBuilder.Append(" : ");
				stringBuilder.Append(this.row1.ToString(format));
				stringBuilder.Append(" : ");
				stringBuilder.Append(this.row2.ToString(format));
				return stringBuilder.ToString();
			}

			// Token: 0x06000896 RID: 2198 RVA: 0x00052F3C File Offset: 0x0005113C
			public string ToStringColumn()
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(this.column0.ToString());
				stringBuilder.Append("(");
				stringBuilder.Append(this.column0.magnitude);
				stringBuilder.Append(") : ");
				stringBuilder.Append(this.column1.ToString());
				stringBuilder.Append("(");
				stringBuilder.Append(this.column1.magnitude);
				stringBuilder.Append(") : ");
				stringBuilder.Append(this.column2.ToString());
				stringBuilder.Append("(");
				stringBuilder.Append(this.column2.magnitude);
				stringBuilder.Append(")");
				return stringBuilder.ToString();
			}

			// Token: 0x06000897 RID: 2199 RVA: 0x0005301C File Offset: 0x0005121C
			public string ToStringColumn(string format)
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(this.column0.ToString(format));
				stringBuilder.Append("(");
				stringBuilder.Append(this.column0.magnitude);
				stringBuilder.Append(") : ");
				stringBuilder.Append(this.column1.ToString(format));
				stringBuilder.Append("(");
				stringBuilder.Append(this.column1.magnitude);
				stringBuilder.Append(") : ");
				stringBuilder.Append(this.column2.ToString(format));
				stringBuilder.Append("(");
				stringBuilder.Append(this.column2.magnitude);
				stringBuilder.Append(")");
				return stringBuilder.ToString();
			}

			// Token: 0x06000898 RID: 2200 RVA: 0x000530EC File Offset: 0x000512EC
			public bool Normalize()
			{
				float num = FullBodyIK.SAFBIKSqrt(this.column0.x * this.column0.x + this.column0.y * this.column0.y + this.column0.z * this.column0.z);
				float num2 = FullBodyIK.SAFBIKSqrt(this.column1.x * this.column1.x + this.column1.y * this.column1.y + this.column1.z * this.column1.z);
				float num3 = FullBodyIK.SAFBIKSqrt(this.column2.x * this.column2.x + this.column2.y * this.column2.y + this.column2.z * this.column2.z);
				bool result = true;
				if (num > 1E-07f)
				{
					num = 1f / num;
					this.column0.x = this.column0.x * num;
					this.column0.y = this.column0.y * num;
					this.column0.z = this.column0.z * num;
				}
				else
				{
					result = false;
					this.column0.x = 1f;
					this.column0.y = 0f;
					this.column0.z = 0f;
				}
				if (num2 > 1E-07f)
				{
					num2 = 1f / num2;
					this.column1.x = this.column1.x * num2;
					this.column1.y = this.column1.y * num2;
					this.column1.z = this.column1.z * num2;
				}
				else
				{
					result = false;
					this.column1.x = 0f;
					this.column1.y = 1f;
					this.column1.z = 0f;
				}
				if (num3 > 1E-07f)
				{
					num3 = 1f / num3;
					this.column2.x = this.column2.x * num3;
					this.column2.y = this.column2.y * num3;
					this.column2.z = this.column2.z * num3;
				}
				else
				{
					result = false;
					this.column2.x = 0f;
					this.column2.y = 0f;
					this.column2.z = 1f;
				}
				return result;
			}

			// Token: 0x04000DC9 RID: 3529
			public Vector3 column0;

			// Token: 0x04000DCA RID: 3530
			public Vector3 column1;

			// Token: 0x04000DCB RID: 3531
			public Vector3 column2;

			// Token: 0x04000DCC RID: 3532
			public static readonly FullBodyIK.Matrix3x3 identity = new FullBodyIK.Matrix3x3(1f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 1f);
		}

		// Token: 0x020001A4 RID: 420
		[Serializable]
		public struct Matrix3x4
		{
			// Token: 0x0600089A RID: 2202 RVA: 0x000533B0 File Offset: 0x000515B0
			public Matrix3x4(FullBodyIK.Matrix3x3 _basis, Vector3 _origin)
			{
				this.basis = _basis;
				this.origin = _origin;
			}

			// Token: 0x0600089B RID: 2203 RVA: 0x000533C0 File Offset: 0x000515C0
			public Matrix3x4(ref FullBodyIK.Matrix3x3 _basis, ref Vector3 _origin)
			{
				this.basis = _basis;
				this.origin = _origin;
			}

			// Token: 0x0600089C RID: 2204 RVA: 0x000533DA File Offset: 0x000515DA
			public Matrix3x4(Quaternion _q, Vector3 _origin)
			{
				FullBodyIK.SAFBIKMatSetRot(out this.basis, ref _q);
				this.origin = _origin;
			}

			// Token: 0x0600089D RID: 2205 RVA: 0x000533F0 File Offset: 0x000515F0
			public Matrix3x4(ref Quaternion _q, ref Vector3 _origin)
			{
				FullBodyIK.SAFBIKMatSetRot(out this.basis, ref _q);
				this.origin = _origin;
			}

			// Token: 0x0600089E RID: 2206 RVA: 0x0005340A File Offset: 0x0005160A
			public Matrix3x4(Matrix4x4 m)
			{
				this.basis = new FullBodyIK.Matrix3x3(ref m);
				this.origin = new Vector3(m.m03, m.m13, m.m23);
			}

			// Token: 0x0600089F RID: 2207 RVA: 0x00053439 File Offset: 0x00051639
			public Matrix3x4(ref Matrix4x4 m)
			{
				this.basis = new FullBodyIK.Matrix3x3(ref m);
				this.origin = new Vector3(m.m03, m.m13, m.m23);
			}

			// Token: 0x1700013A RID: 314
			// (get) Token: 0x060008A0 RID: 2208 RVA: 0x00053464 File Offset: 0x00051664
			public FullBodyIK.Matrix3x4 inverse
			{
				get
				{
					FullBodyIK.Matrix3x3 transpose = this.basis.transpose;
					Vector3 vector = -this.origin;
					Vector3 vector2;
					FullBodyIK.SAFBIKMatMultVec(out vector2, ref transpose, ref vector);
					return new FullBodyIK.Matrix3x4(ref transpose, ref vector2);
				}
			}

			// Token: 0x060008A1 RID: 2209 RVA: 0x000534A0 File Offset: 0x000516A0
			public static implicit operator Matrix4x4(FullBodyIK.Matrix3x4 t)
			{
				Matrix4x4 result = Matrix4x4.identity;
				result.m00 = t.basis.column0.x;
				result.m01 = t.basis.column1.x;
				result.m02 = t.basis.column2.x;
				result.m10 = t.basis.column0.y;
				result.m11 = t.basis.column1.y;
				result.m12 = t.basis.column2.y;
				result.m20 = t.basis.column0.z;
				result.m21 = t.basis.column1.z;
				result.m22 = t.basis.column2.z;
				result.m03 = t.origin.x;
				result.m13 = t.origin.y;
				result.m23 = t.origin.z;
				return result;
			}

			// Token: 0x060008A2 RID: 2210 RVA: 0x000535C5 File Offset: 0x000517C5
			public static implicit operator FullBodyIK.Matrix3x4(Matrix4x4 m)
			{
				return new FullBodyIK.Matrix3x4(ref m);
			}

			// Token: 0x060008A3 RID: 2211 RVA: 0x000535D0 File Offset: 0x000517D0
			public Vector3 Multiply(Vector3 v)
			{
				Vector3 result;
				FullBodyIK.SAFBIKMatMultVecAdd(out result, ref this.basis, ref v, ref this.origin);
				return result;
			}

			// Token: 0x060008A4 RID: 2212 RVA: 0x000535F4 File Offset: 0x000517F4
			public Vector3 Multiply(ref Vector3 v)
			{
				Vector3 result;
				FullBodyIK.SAFBIKMatMultVecAdd(out result, ref this.basis, ref v, ref this.origin);
				return result;
			}

			// Token: 0x060008A5 RID: 2213 RVA: 0x00053618 File Offset: 0x00051818
			public static Vector3 operator *(FullBodyIK.Matrix3x4 t, Vector3 v)
			{
				Vector3 result;
				FullBodyIK.SAFBIKMatMultVecAdd(out result, ref t.basis, ref v, ref t.origin);
				return result;
			}

			// Token: 0x060008A6 RID: 2214 RVA: 0x00053640 File Offset: 0x00051840
			public FullBodyIK.Matrix3x4 Multiply(FullBodyIK.Matrix3x4 t)
			{
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK.SAFBIKMatMult(out matrix3x, ref this.basis, ref t.basis);
				Vector3 vector;
				FullBodyIK.SAFBIKMatMultVecAdd(out vector, ref this.basis, ref t.origin, ref this.origin);
				return new FullBodyIK.Matrix3x4(ref matrix3x, ref vector);
			}

			// Token: 0x060008A7 RID: 2215 RVA: 0x00053684 File Offset: 0x00051884
			public FullBodyIK.Matrix3x4 Multiply(ref FullBodyIK.Matrix3x4 t)
			{
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK.SAFBIKMatMult(out matrix3x, ref this.basis, ref t.basis);
				Vector3 vector;
				FullBodyIK.SAFBIKMatMultVecAdd(out vector, ref this.basis, ref t.origin, ref this.origin);
				return new FullBodyIK.Matrix3x4(ref matrix3x, ref vector);
			}

			// Token: 0x060008A8 RID: 2216 RVA: 0x000536C8 File Offset: 0x000518C8
			public static FullBodyIK.Matrix3x4 operator *(FullBodyIK.Matrix3x4 t1, FullBodyIK.Matrix3x4 t2)
			{
				FullBodyIK.Matrix3x3 matrix3x;
				FullBodyIK.SAFBIKMatMult(out matrix3x, ref t1.basis, ref t2.basis);
				Vector3 vector;
				FullBodyIK.SAFBIKMatMultVecAdd(out vector, ref t1.basis, ref t2.origin, ref t1.origin);
				return new FullBodyIK.Matrix3x4(ref matrix3x, ref vector);
			}

			// Token: 0x060008A9 RID: 2217 RVA: 0x00053710 File Offset: 0x00051910
			public override string ToString()
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append("basis: ");
				stringBuilder.Append(this.basis.ToString());
				stringBuilder.Append(" origin: ");
				stringBuilder.Append(this.origin.ToString());
				return stringBuilder.ToString();
			}

			// Token: 0x060008AA RID: 2218 RVA: 0x00053774 File Offset: 0x00051974
			public string ToString(string format)
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append("basis: ");
				stringBuilder.Append(this.basis.ToString(format));
				stringBuilder.Append(" origin: ");
				stringBuilder.Append(this.origin.ToString(format));
				return stringBuilder.ToString();
			}

			// Token: 0x04000DCD RID: 3533
			public FullBodyIK.Matrix3x3 basis;

			// Token: 0x04000DCE RID: 3534
			public Vector3 origin;

			// Token: 0x04000DCF RID: 3535
			public static readonly FullBodyIK.Matrix3x4 identity = new FullBodyIK.Matrix3x4(FullBodyIK.Matrix3x3.identity, Vector3.zero);
		}

		// Token: 0x020001A5 RID: 421
		[Serializable]
		public struct FastLength
		{
			// Token: 0x060008AC RID: 2220 RVA: 0x000537E1 File Offset: 0x000519E1
			private FastLength(float length_)
			{
				this.length = length_;
				this.lengthSq = length_ * length_;
			}

			// Token: 0x060008AD RID: 2221 RVA: 0x000537F3 File Offset: 0x000519F3
			private FastLength(float length_, float lengthSq_)
			{
				this.length = length_;
				this.lengthSq = lengthSq_;
			}

			// Token: 0x060008AE RID: 2222 RVA: 0x00053803 File Offset: 0x00051A03
			public static FullBodyIK.FastLength FromLength(float length)
			{
				return new FullBodyIK.FastLength(length);
			}

			// Token: 0x060008AF RID: 2223 RVA: 0x0005380B File Offset: 0x00051A0B
			public static FullBodyIK.FastLength FromLengthSq(float lengthSq)
			{
				return new FullBodyIK.FastLength(FullBodyIK.SAFBIKSqrt(lengthSq), lengthSq);
			}

			// Token: 0x060008B0 RID: 2224 RVA: 0x0005381C File Offset: 0x00051A1C
			public static FullBodyIK.FastLength FromVector3(Vector3 v)
			{
				float lengthSq_;
				float length_ = FullBodyIK.SAFBIKVecLengthAndLengthSq(out lengthSq_, ref v);
				return new FullBodyIK.FastLength(length_, lengthSq_);
			}

			// Token: 0x060008B1 RID: 2225 RVA: 0x0005383C File Offset: 0x00051A3C
			public static FullBodyIK.FastLength FromVector3(Vector3 v0, Vector3 v1)
			{
				float lengthSq_;
				float length_ = FullBodyIK.SAFBIKVecLengthAndLengthSq2(out lengthSq_, ref v0, ref v1);
				return new FullBodyIK.FastLength(length_, lengthSq_);
			}

			// Token: 0x060008B2 RID: 2226 RVA: 0x0005385C File Offset: 0x00051A5C
			public static FullBodyIK.FastLength FromVector3(ref Vector3 v)
			{
				float lengthSq_;
				float length_ = FullBodyIK.SAFBIKVecLengthAndLengthSq(out lengthSq_, ref v);
				return new FullBodyIK.FastLength(length_, lengthSq_);
			}

			// Token: 0x060008B3 RID: 2227 RVA: 0x0005387C File Offset: 0x00051A7C
			public static FullBodyIK.FastLength FromVector3(ref Vector3 v0, ref Vector3 v1)
			{
				float lengthSq_;
				float length_ = FullBodyIK.SAFBIKVecLengthAndLengthSq2(out lengthSq_, ref v0, ref v1);
				return new FullBodyIK.FastLength(length_, lengthSq_);
			}

			// Token: 0x04000DD0 RID: 3536
			public float length;

			// Token: 0x04000DD1 RID: 3537
			public float lengthSq;
		}

		// Token: 0x020001A6 RID: 422
		[Serializable]
		public struct FastAngle
		{
			// Token: 0x060008B4 RID: 2228 RVA: 0x0005389A File Offset: 0x00051A9A
			public FastAngle(float angle_)
			{
				this.angle = angle_;
				this.cos = (float)Math.Cos((double)angle_);
				this.sin = (float)Math.Sin((double)angle_);
			}

			// Token: 0x060008B5 RID: 2229 RVA: 0x000538BF File Offset: 0x00051ABF
			public FastAngle(float angle_, float cos_, float sin_)
			{
				this.angle = angle_;
				this.cos = cos_;
				this.sin = sin_;
			}

			// Token: 0x060008B6 RID: 2230 RVA: 0x000538D6 File Offset: 0x00051AD6
			public void Reset()
			{
				this.angle = 0f;
				this.cos = 1f;
				this.sin = 0f;
			}

			// Token: 0x060008B7 RID: 2231 RVA: 0x0005389A File Offset: 0x00051A9A
			public void Reset(float angle_)
			{
				this.angle = angle_;
				this.cos = (float)Math.Cos((double)angle_);
				this.sin = (float)Math.Sin((double)angle_);
			}

			// Token: 0x060008B8 RID: 2232 RVA: 0x000538BF File Offset: 0x00051ABF
			public void Reset(float angle_, float cos_, float sin_)
			{
				this.angle = angle_;
				this.cos = cos_;
				this.sin = sin_;
			}

			// Token: 0x04000DD2 RID: 3538
			public float angle;

			// Token: 0x04000DD3 RID: 3539
			public float cos;

			// Token: 0x04000DD4 RID: 3540
			public float sin;

			// Token: 0x04000DD5 RID: 3541
			public static readonly FullBodyIK.FastAngle zero = new FullBodyIK.FastAngle(0f, 1f, 0f);
		}

		// Token: 0x020001A7 RID: 423
		public struct CachedRate01
		{
			// Token: 0x060008BA RID: 2234 RVA: 0x00053914 File Offset: 0x00051B14
			public CachedRate01(float v)
			{
				this._value = v;
				this.value = Mathf.Clamp01(v);
				this.isGreater0 = (this.value > 1E-07f);
				this.isLess1 = (this.value < 0.9999999f);
			}

			// Token: 0x060008BB RID: 2235 RVA: 0x00053914 File Offset: 0x00051B14
			public void _Reset(float v)
			{
				this._value = v;
				this.value = Mathf.Clamp01(v);
				this.isGreater0 = (this.value > 1E-07f);
				this.isLess1 = (this.value < 0.9999999f);
			}

			// Token: 0x04000DD6 RID: 3542
			public float _value;

			// Token: 0x04000DD7 RID: 3543
			public float value;

			// Token: 0x04000DD8 RID: 3544
			public bool isGreater0;

			// Token: 0x04000DD9 RID: 3545
			public bool isLess1;

			// Token: 0x04000DDA RID: 3546
			public static readonly FullBodyIK.CachedRate01 zero = new FullBodyIK.CachedRate01(0f);
		}

		// Token: 0x020001A8 RID: 424
		public struct CachedDegreesToSin
		{
			// Token: 0x060008BD RID: 2237 RVA: 0x00053960 File Offset: 0x00051B60
			public CachedDegreesToSin(float degrees)
			{
				this._degrees = degrees;
				this.sin = (float)Math.Sin((double)(degrees * 0.017453292f));
			}

			// Token: 0x060008BE RID: 2238 RVA: 0x0005397D File Offset: 0x00051B7D
			public CachedDegreesToSin(float degrees, float sin_)
			{
				this._degrees = degrees;
				this.sin = sin_;
			}

			// Token: 0x060008BF RID: 2239 RVA: 0x00053960 File Offset: 0x00051B60
			public void _Reset(float degrees)
			{
				this._degrees = degrees;
				this.sin = (float)Math.Sin((double)(degrees * 0.017453292f));
			}

			// Token: 0x04000DDB RID: 3547
			public float _degrees;

			// Token: 0x04000DDC RID: 3548
			public float sin;

			// Token: 0x04000DDD RID: 3549
			public static readonly FullBodyIK.CachedDegreesToSin zero = new FullBodyIK.CachedDegreesToSin(0f, 0f);
		}

		// Token: 0x020001A9 RID: 425
		public struct CachedDegreesToCos
		{
			// Token: 0x060008C1 RID: 2241 RVA: 0x000539A3 File Offset: 0x00051BA3
			public CachedDegreesToCos(float degrees)
			{
				this._degrees = degrees;
				this.cos = (float)Math.Cos((double)(degrees * 0.017453292f));
			}

			// Token: 0x060008C2 RID: 2242 RVA: 0x000539C0 File Offset: 0x00051BC0
			public CachedDegreesToCos(float degrees, float cos_)
			{
				this._degrees = degrees;
				this.cos = cos_;
			}

			// Token: 0x060008C3 RID: 2243 RVA: 0x000539A3 File Offset: 0x00051BA3
			public void _Reset(float degrees)
			{
				this._degrees = degrees;
				this.cos = (float)Math.Cos((double)(degrees * 0.017453292f));
			}

			// Token: 0x04000DDE RID: 3550
			public float _degrees;

			// Token: 0x04000DDF RID: 3551
			public float cos;

			// Token: 0x04000DE0 RID: 3552
			public static readonly FullBodyIK.CachedDegreesToCos zero = new FullBodyIK.CachedDegreesToCos(0f, 1f);
		}

		// Token: 0x020001AA RID: 426
		public struct CachedDegreesToCosSin
		{
			// Token: 0x060008C5 RID: 2245 RVA: 0x000539E6 File Offset: 0x00051BE6
			public CachedDegreesToCosSin(float degrees)
			{
				this._degrees = degrees;
				this.cos = (float)Math.Cos((double)(degrees * 0.017453292f));
				this.sin = (float)Math.Sin((double)(degrees * 0.017453292f));
			}

			// Token: 0x060008C6 RID: 2246 RVA: 0x00053A17 File Offset: 0x00051C17
			public CachedDegreesToCosSin(float degrees, float cos_, float sin_)
			{
				this._degrees = degrees;
				this.cos = cos_;
				this.sin = sin_;
			}

			// Token: 0x060008C7 RID: 2247 RVA: 0x000539E6 File Offset: 0x00051BE6
			public void _Reset(float degrees)
			{
				this._degrees = degrees;
				this.cos = (float)Math.Cos((double)(degrees * 0.017453292f));
				this.sin = (float)Math.Sin((double)(degrees * 0.017453292f));
			}

			// Token: 0x04000DE1 RID: 3553
			public float _degrees;

			// Token: 0x04000DE2 RID: 3554
			public float cos;

			// Token: 0x04000DE3 RID: 3555
			public float sin;

			// Token: 0x04000DE4 RID: 3556
			public static readonly FullBodyIK.CachedDegreesToCosSin zero = new FullBodyIK.CachedDegreesToCosSin(0f, 1f, 0f);
		}

		// Token: 0x020001AB RID: 427
		public struct CachedScaledValue
		{
			// Token: 0x060008C9 RID: 2249 RVA: 0x00053A49 File Offset: 0x00051C49
			public CachedScaledValue(float a, float b)
			{
				this._a = a;
				this._b = b;
				this.value = a * b;
			}

			// Token: 0x060008CA RID: 2250 RVA: 0x00053A62 File Offset: 0x00051C62
			public CachedScaledValue(float a, float b, float value_)
			{
				this._a = a;
				this._b = b;
				this.value = value_;
			}

			// Token: 0x060008CB RID: 2251 RVA: 0x00053A79 File Offset: 0x00051C79
			public void Reset(float a, float b)
			{
				if (this._a != a || this._b != b)
				{
					this._a = a;
					this._b = b;
					this.value = a * b;
				}
			}

			// Token: 0x060008CC RID: 2252 RVA: 0x00053A49 File Offset: 0x00051C49
			public void _Reset(float a, float b)
			{
				this._a = a;
				this._b = b;
				this.value = a * b;
			}

			// Token: 0x04000DE5 RID: 3557
			public float _a;

			// Token: 0x04000DE6 RID: 3558
			public float _b;

			// Token: 0x04000DE7 RID: 3559
			public float value;

			// Token: 0x04000DE8 RID: 3560
			public static readonly FullBodyIK.CachedScaledValue zero = new FullBodyIK.CachedScaledValue(0f, 0f, 0f);
		}

		// Token: 0x020001AC RID: 428
		public struct CachedDeg2RadScaledValue
		{
			// Token: 0x060008CE RID: 2254 RVA: 0x00053AC5 File Offset: 0x00051CC5
			public CachedDeg2RadScaledValue(float a, float b)
			{
				this._a = a;
				this._b = b;
				this.value = a * b * 0.017453292f;
			}

			// Token: 0x060008CF RID: 2255 RVA: 0x00053AE4 File Offset: 0x00051CE4
			public CachedDeg2RadScaledValue(float a, float b, float value_)
			{
				this._a = a;
				this._b = b;
				this.value = value_;
			}

			// Token: 0x060008D0 RID: 2256 RVA: 0x00053AFB File Offset: 0x00051CFB
			public void Reset(float a, float b)
			{
				if (this._a != a || this._b != b)
				{
					this._a = a;
					this._b = b;
					this.value = a * b * 0.017453292f;
				}
			}

			// Token: 0x060008D1 RID: 2257 RVA: 0x00053AC5 File Offset: 0x00051CC5
			public void _Reset(float a, float b)
			{
				this._a = a;
				this._b = b;
				this.value = a * b * 0.017453292f;
			}

			// Token: 0x04000DE9 RID: 3561
			public float _a;

			// Token: 0x04000DEA RID: 3562
			public float _b;

			// Token: 0x04000DEB RID: 3563
			public float value;

			// Token: 0x04000DEC RID: 3564
			public static readonly FullBodyIK.CachedDeg2RadScaledValue zero = new FullBodyIK.CachedDeg2RadScaledValue(0f, 0f, 0f);
		}

		// Token: 0x020001AD RID: 429
		public enum EyesType
		{
			// Token: 0x04000DEE RID: 3566
			Normal,
			// Token: 0x04000DEF RID: 3567
			LegacyMove
		}

		// Token: 0x020001AE RID: 430
		public enum Side
		{
			// Token: 0x04000DF1 RID: 3569
			Left,
			// Token: 0x04000DF2 RID: 3570
			Right,
			// Token: 0x04000DF3 RID: 3571
			Max,
			// Token: 0x04000DF4 RID: 3572
			None = 2
		}

		// Token: 0x020001AF RID: 431
		public enum LimbIKType
		{
			// Token: 0x04000DF6 RID: 3574
			Leg,
			// Token: 0x04000DF7 RID: 3575
			Arm,
			// Token: 0x04000DF8 RID: 3576
			Max,
			// Token: 0x04000DF9 RID: 3577
			Unknown = 2
		}

		// Token: 0x020001B0 RID: 432
		public enum LimbIKLocation
		{
			// Token: 0x04000DFB RID: 3579
			LeftLeg,
			// Token: 0x04000DFC RID: 3580
			RightLeg,
			// Token: 0x04000DFD RID: 3581
			LeftArm,
			// Token: 0x04000DFE RID: 3582
			RightArm,
			// Token: 0x04000DFF RID: 3583
			Max,
			// Token: 0x04000E00 RID: 3584
			Unknown = 4
		}

		// Token: 0x020001B1 RID: 433
		public enum FingerIKType
		{
			// Token: 0x04000E02 RID: 3586
			LeftWrist,
			// Token: 0x04000E03 RID: 3587
			RightWrist,
			// Token: 0x04000E04 RID: 3588
			Max,
			// Token: 0x04000E05 RID: 3589
			None = 2
		}

		// Token: 0x020001B2 RID: 434
		public enum BoneType
		{
			// Token: 0x04000E07 RID: 3591
			Hips,
			// Token: 0x04000E08 RID: 3592
			Spine,
			// Token: 0x04000E09 RID: 3593
			Neck,
			// Token: 0x04000E0A RID: 3594
			Head,
			// Token: 0x04000E0B RID: 3595
			Eye,
			// Token: 0x04000E0C RID: 3596
			Leg,
			// Token: 0x04000E0D RID: 3597
			Knee,
			// Token: 0x04000E0E RID: 3598
			Foot,
			// Token: 0x04000E0F RID: 3599
			Shoulder,
			// Token: 0x04000E10 RID: 3600
			Arm,
			// Token: 0x04000E11 RID: 3601
			ArmRoll,
			// Token: 0x04000E12 RID: 3602
			Elbow,
			// Token: 0x04000E13 RID: 3603
			ElbowRoll,
			// Token: 0x04000E14 RID: 3604
			Wrist,
			// Token: 0x04000E15 RID: 3605
			HandFinger,
			// Token: 0x04000E16 RID: 3606
			Max,
			// Token: 0x04000E17 RID: 3607
			Unknown = 15
		}

		// Token: 0x020001B3 RID: 435
		public enum BoneLocation
		{
			// Token: 0x04000E19 RID: 3609
			Hips,
			// Token: 0x04000E1A RID: 3610
			Spine,
			// Token: 0x04000E1B RID: 3611
			Spine2,
			// Token: 0x04000E1C RID: 3612
			Spine3,
			// Token: 0x04000E1D RID: 3613
			Spine4,
			// Token: 0x04000E1E RID: 3614
			Neck,
			// Token: 0x04000E1F RID: 3615
			Head,
			// Token: 0x04000E20 RID: 3616
			LeftEye,
			// Token: 0x04000E21 RID: 3617
			RightEye,
			// Token: 0x04000E22 RID: 3618
			LeftLeg,
			// Token: 0x04000E23 RID: 3619
			RightLeg,
			// Token: 0x04000E24 RID: 3620
			LeftKnee,
			// Token: 0x04000E25 RID: 3621
			RightKnee,
			// Token: 0x04000E26 RID: 3622
			LeftFoot,
			// Token: 0x04000E27 RID: 3623
			RightFoot,
			// Token: 0x04000E28 RID: 3624
			LeftShoulder,
			// Token: 0x04000E29 RID: 3625
			RightShoulder,
			// Token: 0x04000E2A RID: 3626
			LeftArm,
			// Token: 0x04000E2B RID: 3627
			RightArm,
			// Token: 0x04000E2C RID: 3628
			LeftArmRoll0,
			// Token: 0x04000E2D RID: 3629
			LeftArmRoll1,
			// Token: 0x04000E2E RID: 3630
			LeftArmRoll2,
			// Token: 0x04000E2F RID: 3631
			LeftArmRoll3,
			// Token: 0x04000E30 RID: 3632
			RightArmRoll0,
			// Token: 0x04000E31 RID: 3633
			RightArmRoll1,
			// Token: 0x04000E32 RID: 3634
			RightArmRoll2,
			// Token: 0x04000E33 RID: 3635
			RightArmRoll3,
			// Token: 0x04000E34 RID: 3636
			LeftElbow,
			// Token: 0x04000E35 RID: 3637
			RightElbow,
			// Token: 0x04000E36 RID: 3638
			LeftElbowRoll0,
			// Token: 0x04000E37 RID: 3639
			LeftElbowRoll1,
			// Token: 0x04000E38 RID: 3640
			LeftElbowRoll2,
			// Token: 0x04000E39 RID: 3641
			LeftElbowRoll3,
			// Token: 0x04000E3A RID: 3642
			RightElbowRoll0,
			// Token: 0x04000E3B RID: 3643
			RightElbowRoll1,
			// Token: 0x04000E3C RID: 3644
			RightElbowRoll2,
			// Token: 0x04000E3D RID: 3645
			RightElbowRoll3,
			// Token: 0x04000E3E RID: 3646
			LeftWrist,
			// Token: 0x04000E3F RID: 3647
			RightWrist,
			// Token: 0x04000E40 RID: 3648
			LeftHandThumb0,
			// Token: 0x04000E41 RID: 3649
			LeftHandThumb1,
			// Token: 0x04000E42 RID: 3650
			LeftHandThumb2,
			// Token: 0x04000E43 RID: 3651
			LeftHandThumbTip,
			// Token: 0x04000E44 RID: 3652
			LeftHandIndex0,
			// Token: 0x04000E45 RID: 3653
			LeftHandIndex1,
			// Token: 0x04000E46 RID: 3654
			LeftHandIndex2,
			// Token: 0x04000E47 RID: 3655
			LeftHandIndexTip,
			// Token: 0x04000E48 RID: 3656
			LeftHandMiddle0,
			// Token: 0x04000E49 RID: 3657
			LeftHandMiddle1,
			// Token: 0x04000E4A RID: 3658
			LeftHandMiddle2,
			// Token: 0x04000E4B RID: 3659
			LeftHandMiddleTip,
			// Token: 0x04000E4C RID: 3660
			LeftHandRing0,
			// Token: 0x04000E4D RID: 3661
			LeftHandRing1,
			// Token: 0x04000E4E RID: 3662
			LeftHandRing2,
			// Token: 0x04000E4F RID: 3663
			LeftHandRingTip,
			// Token: 0x04000E50 RID: 3664
			LeftHandLittle0,
			// Token: 0x04000E51 RID: 3665
			LeftHandLittle1,
			// Token: 0x04000E52 RID: 3666
			LeftHandLittle2,
			// Token: 0x04000E53 RID: 3667
			LeftHandLittleTip,
			// Token: 0x04000E54 RID: 3668
			RightHandThumb0,
			// Token: 0x04000E55 RID: 3669
			RightHandThumb1,
			// Token: 0x04000E56 RID: 3670
			RightHandThumb2,
			// Token: 0x04000E57 RID: 3671
			RightHandThumbTip,
			// Token: 0x04000E58 RID: 3672
			RightHandIndex0,
			// Token: 0x04000E59 RID: 3673
			RightHandIndex1,
			// Token: 0x04000E5A RID: 3674
			RightHandIndex2,
			// Token: 0x04000E5B RID: 3675
			RightHandIndexTip,
			// Token: 0x04000E5C RID: 3676
			RightHandMiddle0,
			// Token: 0x04000E5D RID: 3677
			RightHandMiddle1,
			// Token: 0x04000E5E RID: 3678
			RightHandMiddle2,
			// Token: 0x04000E5F RID: 3679
			RightHandMiddleTip,
			// Token: 0x04000E60 RID: 3680
			RightHandRing0,
			// Token: 0x04000E61 RID: 3681
			RightHandRing1,
			// Token: 0x04000E62 RID: 3682
			RightHandRing2,
			// Token: 0x04000E63 RID: 3683
			RightHandRingTip,
			// Token: 0x04000E64 RID: 3684
			RightHandLittle0,
			// Token: 0x04000E65 RID: 3685
			RightHandLittle1,
			// Token: 0x04000E66 RID: 3686
			RightHandLittle2,
			// Token: 0x04000E67 RID: 3687
			RightHandLittleTip,
			// Token: 0x04000E68 RID: 3688
			Max,
			// Token: 0x04000E69 RID: 3689
			Unknown = 79,
			// Token: 0x04000E6A RID: 3690
			SpineU = 4
		}

		// Token: 0x020001B4 RID: 436
		public enum EffectorType
		{
			// Token: 0x04000E6C RID: 3692
			Root,
			// Token: 0x04000E6D RID: 3693
			Hips,
			// Token: 0x04000E6E RID: 3694
			Neck,
			// Token: 0x04000E6F RID: 3695
			Head,
			// Token: 0x04000E70 RID: 3696
			Eyes,
			// Token: 0x04000E71 RID: 3697
			Knee,
			// Token: 0x04000E72 RID: 3698
			Foot,
			// Token: 0x04000E73 RID: 3699
			Arm,
			// Token: 0x04000E74 RID: 3700
			Elbow,
			// Token: 0x04000E75 RID: 3701
			Wrist,
			// Token: 0x04000E76 RID: 3702
			HandFinger,
			// Token: 0x04000E77 RID: 3703
			Max,
			// Token: 0x04000E78 RID: 3704
			Unknown = 11
		}

		// Token: 0x020001B5 RID: 437
		public enum EffectorLocation
		{
			// Token: 0x04000E7A RID: 3706
			Root,
			// Token: 0x04000E7B RID: 3707
			Hips,
			// Token: 0x04000E7C RID: 3708
			Neck,
			// Token: 0x04000E7D RID: 3709
			Head,
			// Token: 0x04000E7E RID: 3710
			Eyes,
			// Token: 0x04000E7F RID: 3711
			LeftKnee,
			// Token: 0x04000E80 RID: 3712
			RightKnee,
			// Token: 0x04000E81 RID: 3713
			LeftFoot,
			// Token: 0x04000E82 RID: 3714
			RightFoot,
			// Token: 0x04000E83 RID: 3715
			LeftArm,
			// Token: 0x04000E84 RID: 3716
			RightArm,
			// Token: 0x04000E85 RID: 3717
			LeftElbow,
			// Token: 0x04000E86 RID: 3718
			RightElbow,
			// Token: 0x04000E87 RID: 3719
			LeftWrist,
			// Token: 0x04000E88 RID: 3720
			RightWrist,
			// Token: 0x04000E89 RID: 3721
			LeftHandThumb,
			// Token: 0x04000E8A RID: 3722
			LeftHandIndex,
			// Token: 0x04000E8B RID: 3723
			LeftHandMiddle,
			// Token: 0x04000E8C RID: 3724
			LeftHandRing,
			// Token: 0x04000E8D RID: 3725
			LeftHandLittle,
			// Token: 0x04000E8E RID: 3726
			RightHandThumb,
			// Token: 0x04000E8F RID: 3727
			RightHandIndex,
			// Token: 0x04000E90 RID: 3728
			RightHandMiddle,
			// Token: 0x04000E91 RID: 3729
			RightHandRing,
			// Token: 0x04000E92 RID: 3730
			RightHandLittle,
			// Token: 0x04000E93 RID: 3731
			Max,
			// Token: 0x04000E94 RID: 3732
			Unknown = 25
		}

		// Token: 0x020001B6 RID: 438
		public enum FingerType
		{
			// Token: 0x04000E96 RID: 3734
			Thumb,
			// Token: 0x04000E97 RID: 3735
			Index,
			// Token: 0x04000E98 RID: 3736
			Middle,
			// Token: 0x04000E99 RID: 3737
			Ring,
			// Token: 0x04000E9A RID: 3738
			Little,
			// Token: 0x04000E9B RID: 3739
			Max,
			// Token: 0x04000E9C RID: 3740
			Unknown = 5
		}

		// Token: 0x020001B7 RID: 439
		public enum _DirectionAs
		{
			// Token: 0x04000E9E RID: 3742
			None,
			// Token: 0x04000E9F RID: 3743
			XPlus,
			// Token: 0x04000EA0 RID: 3744
			XMinus,
			// Token: 0x04000EA1 RID: 3745
			YPlus,
			// Token: 0x04000EA2 RID: 3746
			YMinus,
			// Token: 0x04000EA3 RID: 3747
			Max,
			// Token: 0x04000EA4 RID: 3748
			Uknown = 5
		}
	}
}
